All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
eap_chbind.h
Go to the documentation of this file.
1 /*
2  * eap_chbind.c
3  *
4  * Version: $Id: 914e36447ad97b7a59b3b05166c751961bbcad76 $
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  * Copyright 2014 Network RADIUS SARL
21  * Copyright 2014 The FreeRADIUS server project
22  */
23 
24 #ifndef _EAP_CHBIND_H
25 #define _EAP_CHBIND_H
26 
27 RCSIDH(eap_chbind_h, "$Id: 914e36447ad97b7a59b3b05166c751961bbcad76 $")
28 
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <sys/types.h>
32 #include <ctype.h>
33 
34 #include <freeradius-devel/radiusd.h>
35 
36 #include "eap.h"
37 
38 /* Structure to represent eap channel binding packet format */
39 typedef struct chbind_packet_t {
40  uint8_t code;
41  uint8_t data[1];
43 
44 /* Structure to hold channel bindings req/resp information */
45 typedef struct CHBIND_REQ {
46  VALUE_PAIR *username; /* the username */
47  chbind_packet_t *request; /* channel binding request buffer */
48  chbind_packet_t *response; /* channel binding response buffer */
49 } CHBIND_REQ;
50 
51 /* Protocol constants */
52 #define CHBIND_NSID_RADIUS 1
53 
54 #define CHBIND_CODE_REQUEST 1
55 #define CHBIND_CODE_SUCCESS 2
56 #define CHBIND_CODE_FAILURE 3
57 
58 /* Channel binding function prototypes */
59 PW_CODE chbind_process(REQUEST *request, CHBIND_REQ *chbind_req);
60 
62 chbind_packet_t *eap_chbind_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps);
63 
64 #endif /*_EAP_CHBIND_H*/
#define RCSIDH(h, id)
Definition: build.h:136
uint8_t code
Definition: eap_chbind.h:40
struct chbind_packet_t chbind_packet_t
PW_CODE chbind_process(REQUEST *request, CHBIND_REQ *chbind_req)
Definition: eap_chbind.c:156
Stores an attribute, a value and various bits of other data.
Definition: pair.h:112
chbind_packet_t * request
Definition: eap_chbind.h:47
chbind_packet_t * response
Definition: eap_chbind.h:48
uint8_t data[1]
Definition: eap_chbind.h:41
struct CHBIND_REQ CHBIND_REQ
VALUE_PAIR * username
Definition: eap_chbind.h:46
PW_CODE
RADIUS packet codes.
Definition: radius.h:90
chbind_packet_t * eap_chbind_vp2packet(TALLOC_CTX *ctx, VALUE_PAIR *vps)
Definition: eap_chbind.c:245
VALUE_PAIR * eap_chbind_packet2vp(REQUEST *request, chbind_packet_t *packet)
Definition: eap_chbind.c:291