]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Add some Microsoft specific EAP types, and a enum_name getter them
authorMartin Willi <martin@revosec.ch>
Thu, 30 Aug 2012 09:15:38 +0000 (11:15 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 3 Sep 2012 08:25:16 +0000 (10:25 +0200)
src/libstrongswan/eap/eap.c
src/libstrongswan/eap/eap.h

index 2ae3393a4fa5b82f155d6c2cd5cddcf22d949570..53319a4f6b3b5f34c736d89ce192fe4d5a0b12a9 100644 (file)
@@ -93,6 +93,31 @@ ENUM_NEXT(eap_type_short_names, EAP_EXPANDED, EAP_DYNAMIC, EAP_TNC,
        "DYN");
 ENUM_END(eap_type_short_names, EAP_DYNAMIC);
 
+ENUM(eap_vendor_names_unknown, 0, 0,
+       "(0)",
+);
+
+ENUM(eap_vendor_names_ms, EAP_MS_SOH, EAP_MS_CAPABILITES,
+       "MS-SOH",
+       "MS-CAP",
+);
+
+/*
+ * See header
+ */
+enum_name_t* eap_type_get_names(pen_t vendor)
+{
+       switch (vendor)
+       {
+               case PEN_IETF:
+                       return eap_type_short_names;
+               case PEN_MICROSOFT:
+                       return eap_vendor_names_ms;
+               default:
+                       return eap_vendor_names_unknown;
+       }
+}
+
 /*
  * See header
  */
index 73f6d7f27556302a7d39b39328d52615f64cb52f..40a4d3f6d46e70f22d374f2bf536a11b8f662adf 100644 (file)
 
 typedef enum eap_code_t eap_code_t;
 typedef enum eap_type_t eap_type_t;
+typedef enum eap_vendor_type_t eap_vendor_type_t;
 
 #include <library.h>
+#include <pen/pen.h>
 
 /**
  * EAP code, type of an EAP message
@@ -84,6 +86,21 @@ extern enum_name_t *eap_type_names;
  */
 extern enum_name_t *eap_type_short_names;
 
+/**
+ * Vendor specific types. Vendors itself are defined as pen_t.
+ */
+enum eap_vendor_type_t {
+       /** Microsoft Statement of Health */
+       EAP_MS_SOH = 0x21,
+       /** Microsoft PEAP Capabilities */
+       EAP_MS_CAPABILITES = 0x22,
+};
+
+/**
+ * Get the enum names for a specific vendor
+ */
+enum_name_t* eap_type_get_names(pen_t vendor);
+
 /**
  * EAP packet format
  */