xref: /netbsd-src/external/bsd/wpa/dist/src/eap_common/eap_common.h (revision bb6183629cf165db498d8e1f4e2de129f7efb21c)
18dbcf02cSchristos /*
28dbcf02cSchristos  * EAP common peer/server definitions
3bb610346Schristos  * Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
48dbcf02cSchristos  *
5e604d861Schristos  * This software may be distributed under the terms of the BSD license.
6e604d861Schristos  * See README for more details.
78dbcf02cSchristos  */
88dbcf02cSchristos 
98dbcf02cSchristos #ifndef EAP_COMMON_H
108dbcf02cSchristos #define EAP_COMMON_H
118dbcf02cSchristos 
128dbcf02cSchristos #include "wpabuf.h"
138dbcf02cSchristos 
14bb610346Schristos struct erp_tlvs {
15bb610346Schristos 	const u8 *keyname;
16bb610346Schristos 	const u8 *domain;
17bb610346Schristos 
18bb610346Schristos 	u8 keyname_len;
19bb610346Schristos 	u8 domain_len;
20bb610346Schristos };
21bb610346Schristos 
22e604d861Schristos int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload);
23*bb618362Schristos const u8 * eap_hdr_validate(int vendor, enum eap_type eap_type,
248dbcf02cSchristos 			    const struct wpabuf *msg, size_t *plen);
25*bb618362Schristos struct wpabuf * eap_msg_alloc(int vendor, enum eap_type type,
26*bb618362Schristos 			      size_t payload_len, u8 code, u8 identifier);
278dbcf02cSchristos void eap_update_len(struct wpabuf *msg);
288dbcf02cSchristos u8 eap_get_id(const struct wpabuf *msg);
29*bb618362Schristos enum eap_type eap_get_type(const struct wpabuf *msg);
30bb610346Schristos int erp_parse_tlvs(const u8 *pos, const u8 *end, struct erp_tlvs *tlvs,
31bb610346Schristos 		   int stop_at_keyname);
328dbcf02cSchristos 
338dbcf02cSchristos #endif /* EAP_COMMON_H */
34