The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
chbind.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or (at
6  * your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: adc6a9f506a45e036188490dc730001f7b40a226 $
20  * @file lib/eap/chbind.h
21  * @brief Channel binding
22  *
23  * @copyright 2014 Network RADIUS SAS
24  * @copyright 2014 The FreeRADIUS server project
25  */
26 
27 RCSIDH(lib_eap_chbind_h, "$Id: adc6a9f506a45e036188490dc730001f7b40a226 $")
28 
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <sys/types.h>
32 #include <ctype.h>
33 
34 #include <freeradius-devel/eap/base.h>
35 #include <freeradius-devel/server/base.h>
36 #include <freeradius-devel/radius/radius.h>
37 #include <freeradius-devel/radius/defs.h>
38 
39 /* Structure to represent eap channel binding packet format */
40 typedef struct {
44 
45 /* Structure to hold channel bindings req/resp information */
46 typedef struct {
47  fr_pair_t *username; /* the username */
48  chbind_packet_t *request; /* channel binding request buffer */
49  chbind_packet_t *response; /* channel binding response buffer */
50 } CHBIND_REQ;
51 
52 /* Protocol constants */
53 #define CHBIND_NSID_RADIUS 1
54 
55 #define CHBIND_CODE_REQUEST 1
56 #define CHBIND_CODE_SUCCESS 2
57 #define CHBIND_CODE_FAILURE 3
58 
59 /* Channel binding function prototypes */
61 
62 fr_pair_t *eap_chbind_packet2vp(TALLOC_CTX *ctx, chbind_packet_t *chbind);
#define RCSIDH(h, id)
Definition: build.h:482
chbind_packet_t * response
Definition: chbind.h:49
fr_pair_t * username
Definition: chbind.h:47
chbind_packet_t * eap_chbind_vp2packet(TALLOC_CTX *ctx, fr_pair_list_t *vps)
Definition: chbind.c:269
fr_pair_t * eap_chbind_packet2vp(TALLOC_CTX *ctx, chbind_packet_t *chbind)
Definition: chbind.c:314
chbind_packet_t * request
Definition: chbind.h:48
fr_radius_packet_code_t chbind_process(request_t *request, CHBIND_REQ *chbind_req)
Definition: chbind.c:170
uint8_t code
Definition: chbind.h:41
fr_radius_packet_code_t
RADIUS packet codes.
Definition: defs.h:31
unsigned char uint8_t
Definition: merged_model.c:30
Stores an attribute, a value and various bits of other data.
Definition: pair.h:68
static fr_slen_t data
Definition: value.h:1265