]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Add a convenience method to check pen_type_t for vendor and type
authorMartin Willi <martin@revosec.ch>
Thu, 31 Jan 2013 14:43:45 +0000 (15:43 +0100)
committerMartin Willi <martin@revosec.ch>
Thu, 14 Feb 2013 16:17:30 +0000 (17:17 +0100)
src/libstrongswan/pen/pen.h

index 52123f855b075138e30a706a06efc12e5bf210db..29e312c616e45f230f14c3949445e5bc00f7b734 100644 (file)
@@ -85,6 +85,20 @@ static inline bool pen_type_equals(pen_type_t a, pen_type_t b)
        return a.vendor_id == b.vendor_id && a.type == b.type;
 }
 
+/**
+ * Check if a pen_type_t matches vendor and type.
+ *
+ * @param pen_type             pen_type_t to compare
+ * @param vendor_id            vendor to check in pen_type
+ * @param type                 type to check in pen_type
+ * @return                             TRUE if vendor_id and type matches pen_type
+ */
+static inline bool pen_type_is(pen_type_t pen_type,
+                                                          pen_t vendor_id, u_int32_t type)
+{
+       return pen_type.vendor_id == vendor_id && pen_type.type == type;
+}
+
 /**
  * enum names for pen_t.
  */