The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Functions | Variables
base.c File Reference

Code common to clients and to servers. More...

#include <freeradius-devel/eap/base.h>
#include <freeradius-devel/server/virtual_servers.h>
#include <freeradius-devel/server/pair.h>
#include <freeradius-devel/server/auth.h>
#include <freeradius-devel/unlang/call.h>
#include "types.h"
#include "attrs.h"
+ Include dependency graph for base.c:

Go to the source code of this file.

Macros

#define LOG_PREFIX   "eap"
 

Functions

void eap_add_reply (request_t *request, fr_dict_attr_t const *da, uint8_t const *value, int len)
 
void eap_base_free (void)
 De-init the lib eap base library. More...
 
int eap_base_init (void)
 Initialise the lib eap base library. More...
 
static bool eap_is_valid (TALLOC_CTX *ctx, eap_packet_raw_t **eap_packet_p)
 Basic EAP packet verifications & validations. More...
 
eap_packet_raw_teap_packet_from_vp (TALLOC_CTX *ctx, fr_pair_list_t *vps)
 
void eap_packet_to_vp (TALLOC_CTX *ctx, fr_pair_list_t *list, eap_packet_raw_t const *eap)
 
rlm_rcode_t eap_virtual_server (UNUSED request_t *request, UNUSED eap_session_t *eap_session, UNUSED char const *virtual_server)
 Run a subrequest through a virtual server, managing the eap_session_t of the child. More...
 

Variables

fr_dict_attr_t const * attr_chbind_response_code
 
fr_dict_attr_t const * attr_eap_channel_binding_message
 
fr_dict_attr_t const * attr_eap_emsk
 
fr_dict_attr_t const * attr_eap_identity
 
fr_dict_attr_t const * attr_eap_message
 
fr_dict_attr_t const * attr_eap_msk
 
fr_dict_attr_t const * attr_eap_session_id
 
fr_dict_attr_t const * attr_eap_type
 
fr_dict_attr_t const * attr_freeradius_proxied_to
 
fr_dict_attr_t const * attr_message_authenticator
 
fr_dict_attr_t const * attr_ms_mppe_recv_key
 
fr_dict_attr_t const * attr_ms_mppe_send_key
 
fr_dict_attr_t const * attr_state
 
fr_dict_attr_t const * attr_user_name
 
fr_dict_t const * dict_freeradius
 
fr_dict_t const * dict_radius
 
fr_dict_autoload_t eap_base_dict []
 
fr_dict_attr_autoload_t eap_base_dict_attr []
 

Detailed Description

Code common to clients and to servers.

Id
e4e7c3348502ce294cf0eb18047e9c3fe4357ee3

Definition in file base.c.

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   "eap"

Definition at line 63 of file base.c.

Function Documentation

◆ eap_add_reply()

void eap_add_reply ( request_t request,
fr_dict_attr_t const *  da,
uint8_t const *  value,
int  len 
)

Definition at line 375 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_base_free()

void eap_base_free ( void  )

De-init the lib eap base library.

Definition at line 489 of file base.c.

+ Here is the caller graph for this function:

◆ eap_base_init()

int eap_base_init ( void  )

Initialise the lib eap base library.

Definition at line 466 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_is_valid()

static bool eap_is_valid ( TALLOC_CTX *  ctx,
eap_packet_raw_t **  eap_packet_p 
)
static

Basic EAP packet verifications & validations.

Parameters
[in]ctxtalloc ctx for the eap packet.
[in]eap_packet_pto validate.
Returns
  • true the packet is valid.
  • false the packet is invalid.

Definition at line 157 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_packet_from_vp()

eap_packet_raw_t* eap_packet_from_vp ( TALLOC_CTX *  ctx,
fr_pair_list_t vps 
)

Definition at line 279 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ eap_packet_to_vp()

void eap_packet_to_vp ( TALLOC_CTX *  ctx,
fr_pair_list_t list,
eap_packet_raw_t const *  eap 
)

Definition at line 120 of file base.c.

+ Here is the call graph for this function:

◆ eap_virtual_server()

rlm_rcode_t eap_virtual_server ( UNUSED request_t request,
UNUSED eap_session_t eap_session,
UNUSED char const *  virtual_server 
)

Run a subrequest through a virtual server, managing the eap_session_t of the child.

If eap_session_t has a child, inject that into the request.

If after the request has run, the child eap_session_t is no longer present, we assume it has been freed, and fixup the parent eap_session_t.

If the eap_session_t pointer changes, this is considered a fatal error.

Parameters
[in]requestthe current (real) request.
[in]eap_sessionrepresenting the outer eap method.
[in]virtual_serverThe default virtual server to send the request to.
Returns
the rcode of the last executed section in the virtual server.

Definition at line 401 of file base.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ attr_chbind_response_code

fr_dict_attr_t const* attr_chbind_response_code

Definition at line 83 of file base.c.

◆ attr_eap_channel_binding_message

fr_dict_attr_t const* attr_eap_channel_binding_message

Definition at line 89 of file base.c.

◆ attr_eap_emsk

fr_dict_attr_t const* attr_eap_emsk

Definition at line 92 of file base.c.

◆ attr_eap_identity

fr_dict_attr_t const* attr_eap_identity

Definition at line 85 of file base.c.

◆ attr_eap_message

fr_dict_attr_t const* attr_eap_message

Definition at line 90 of file base.c.

◆ attr_eap_msk

fr_dict_attr_t const* attr_eap_msk

Definition at line 91 of file base.c.

◆ attr_eap_session_id

fr_dict_attr_t const* attr_eap_session_id

Definition at line 84 of file base.c.

◆ attr_eap_type

fr_dict_attr_t const* attr_eap_type

Definition at line 86 of file base.c.

◆ attr_freeradius_proxied_to

fr_dict_attr_t const* attr_freeradius_proxied_to

Definition at line 93 of file base.c.

◆ attr_message_authenticator

fr_dict_attr_t const* attr_message_authenticator

Definition at line 88 of file base.c.

◆ attr_ms_mppe_recv_key

fr_dict_attr_t const* attr_ms_mppe_recv_key

Definition at line 95 of file base.c.

◆ attr_ms_mppe_send_key

fr_dict_attr_t const* attr_ms_mppe_send_key

Definition at line 94 of file base.c.

◆ attr_state

fr_dict_attr_t const* attr_state

Definition at line 96 of file base.c.

◆ attr_user_name

fr_dict_attr_t const* attr_user_name

Definition at line 97 of file base.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius

Definition at line 73 of file base.c.

◆ dict_radius

fr_dict_t const* dict_radius

Definition at line 74 of file base.c.

◆ eap_base_dict

fr_dict_autoload_t eap_base_dict
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
fr_dict_t const * dict_freeradius
Definition: base.c:73
fr_dict_t const * dict_radius
Definition: base.c:74

Definition at line 77 of file base.c.

◆ eap_base_dict_attr

fr_dict_attr_autoload_t eap_base_dict_attr
Initial value:
= {
{ .out = &attr_chbind_response_code, .name = "Chbind-Response-Code", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
{ .out = &attr_eap_identity, .name = "EAP-Identity", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ .out = &attr_eap_session_id, .name = "EAP-Session-Id", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
{ .out = &attr_eap_type, .name = "EAP-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
{ .out = &attr_state, .name = "State", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_message_authenticator, .name = "Message-Authenticator", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_eap_channel_binding_message, .name = "Vendor-Specific.UKERNA.EAP-Channel-Binding-Message", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_eap_message, .name = "EAP-Message", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_eap_msk, .name = "EAP-MSK", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
{ .out = &attr_eap_emsk, .name = "EAP-EMSK", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
{ .out = &attr_freeradius_proxied_to, .name = "Vendor-Specific.FreeRADIUS.Proxied-To", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_radius },
{ .out = &attr_ms_mppe_send_key, .name = "Vendor-Specific.Microsoft.MPPE-Send-Key", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_mppe_recv_key, .name = "Vendor-Specific.Microsoft.MPPE-Recv-Key", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_user_name, .name = "User-Name", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ NULL }
}
fr_dict_attr_t const * attr_eap_session_id
Definition: base.c:84
fr_dict_attr_t const * attr_state
Definition: base.c:96
fr_dict_attr_t const * attr_eap_identity
Definition: base.c:85
fr_dict_attr_t const * attr_freeradius_proxied_to
Definition: base.c:93
fr_dict_attr_t const * attr_chbind_response_code
Definition: base.c:83
fr_dict_attr_t const * attr_eap_message
Definition: base.c:90
fr_dict_attr_t const * attr_eap_type
Definition: base.c:86
fr_dict_attr_t const * attr_eap_msk
Definition: base.c:91
fr_dict_attr_t const * attr_eap_channel_binding_message
Definition: base.c:89
fr_dict_attr_t const * attr_eap_emsk
Definition: base.c:92
fr_dict_attr_t const * attr_ms_mppe_send_key
Definition: base.c:94
fr_dict_attr_t const * attr_user_name
Definition: base.c:97
fr_dict_attr_t const * attr_ms_mppe_recv_key
Definition: base.c:95
fr_dict_attr_t const * attr_message_authenticator
Definition: base.c:88
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
Definition: merged_model.c:86
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84

Definition at line 100 of file base.c.