/*
* interfaces in eapsimlib.c
*/
-extern int map_eapsim_types(RADIUS_PACKET *r);
extern int map_eapsim_basictypes(RADIUS_PACKET *r, EAP_PACKET *ep);
-extern int unmap_eapsim_types(RADIUS_PACKET *r);
extern const char *sim_state2name(enum eapsim_clientstates state, char *buf, int buflen);
extern const char *sim_subtype2name(enum eapsim_subtype subtype, char *buf, int buflen);
extern int unmap_eapsim_basictypes(RADIUS_PACKET *r,
return 1;
}
-int map_eapsim_types(RADIUS_PACKET *r)
-{
- EAP_PACKET ep;
- int ret;
-
- memset(&ep, 0, sizeof(ep));
- ret = map_eapsim_basictypes(r, &ep);
- if(ret != 1) {
- return ret;
- }
- eap_basic_compose(r, &ep);
-
- return 1;
-}
-
/*
* given a radius request with an EAP-SIM body, decode it into TLV pairs
*
return 1;
}
-int unmap_eapsim_types(RADIUS_PACKET *r)
-{
- VALUE_PAIR *esvp;
-
- esvp = pairfind(r->vps, ATTRIBUTE_EAP_BASE+PW_EAP_SIM);
- if (esvp == NULL) {
- radlog(L_ERR, "eap: EAP-Sim attribute not found");
- return 0;
- }
-
- return unmap_eapsim_basictypes(r, esvp->vp_octets, esvp->length);
-}
-
/*
* calculate the MAC for the EAP message, given the key.
* The "extra" will be appended to the EAP message and included in the
static void map_eap_types(RADIUS_PACKET *req);
static void unmap_eap_types(RADIUS_PACKET *rep);
+static int map_eapsim_types(RADIUS_PACKET *r);
+static int unmap_eapsim_types(RADIUS_PACKET *r);
static void NEVER_RETURNS usage(void)
{
return;
}
+static int map_eapsim_types(RADIUS_PACKET *r)
+{
+ EAP_PACKET ep;
+ int ret;
+
+ memset(&ep, 0, sizeof(ep));
+ ret = map_eapsim_basictypes(r, &ep);
+ if(ret != 1) {
+ return ret;
+ }
+ eap_basic_compose(r, &ep);
+
+ return 1;
+}
+
+static int unmap_eapsim_types(RADIUS_PACKET *r)
+{
+ VALUE_PAIR *esvp;
+
+ esvp = pairfind(r->vps, ATTRIBUTE_EAP_BASE+PW_EAP_SIM);
+ if (esvp == NULL) {
+ radlog(L_ERR, "eap: EAP-Sim attribute not found");
+ return 0;
+ }
+
+ return unmap_eapsim_basictypes(r, esvp->vp_octets, esvp->length);
+}
+
#ifdef TEST_CASE
#include <assert.h>
}
}
#endif
+