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

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

#include <freeradius-devel/eap/base.h>
#include <freeradius-devel/radius/defs.h>
#include <freeradius-devel/server/state.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 <freeradius-devel/unlang/interpret.h>
#include <freeradius-devel/unlang/function.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.
 
int eap_base_init (void)
 Initialise the lib eap base library.
 
static bool eap_is_valid (TALLOC_CTX *ctx, eap_packet_raw_t **eap_packet_p)
 Basic EAP packet verifications & validations.
 
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)
 
unlang_action_t eap_virtual_server (request_t *request, eap_session_t *eap_session, CONF_SECTION *server_cs)
 Run a subrequest through a virtual server.
 
static unlang_action_t eap_virtual_server_resume (UNUSED rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
 Handle the result of running a subrequest through a virtual server.
 

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_framed_mtu
 
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_packet_type
 
fr_dict_attr_t const * attr_state
 
fr_dict_attr_t const * attr_tls_max_version
 
fr_dict_attr_t const * attr_tls_min_version
 
fr_dict_attr_t const * attr_user_name
 
fr_dict_t const * dict_freeradius
 
fr_dict_t const * dict_radius
 
fr_dict_t const * dict_tls
 
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
55db89cc494d1ee0b3de0f628947dcd2e23021f2

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 387 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 478 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 455 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 169 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 291 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 132 of file base.c.

+ Here is the call graph for this function:

◆ eap_virtual_server()

unlang_action_t eap_virtual_server ( request_t request,
eap_session_t eap_session,
CONF_SECTION server_cs 
)

Run a subrequest through a virtual server.

If eap_session_t has a child_state, inject that as an attribute in the request.

Parameters
[in]requestthe current (real) request.
[in]eap_sessionrepresenting the outer eap method.
[in]server_csThe virtual server to send the request to.
Returns
  • UNLANG_ACTION_PUSHED_CHILD on success
  • UNLANG_ACTION_FAIL on error

Definition at line 427 of file base.c.

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

◆ eap_virtual_server_resume()

static unlang_action_t eap_virtual_server_resume ( UNUSED rlm_rcode_t p_result,
UNUSED int *  priority,
request_t request,
void *  uctx 
)
static

Handle the result of running a subrequest through a virtual server.

Storing the value of the State attribute in readiness for the next round.

Definition at line 403 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 89 of file base.c.

◆ attr_eap_channel_binding_message

fr_dict_attr_t const* attr_eap_channel_binding_message

Definition at line 95 of file base.c.

◆ attr_eap_emsk

fr_dict_attr_t const* attr_eap_emsk

Definition at line 98 of file base.c.

◆ attr_eap_identity

fr_dict_attr_t const* attr_eap_identity

Definition at line 91 of file base.c.

◆ attr_eap_message

fr_dict_attr_t const* attr_eap_message

Definition at line 96 of file base.c.

◆ attr_eap_msk

fr_dict_attr_t const* attr_eap_msk

Definition at line 97 of file base.c.

◆ attr_eap_session_id

fr_dict_attr_t const* attr_eap_session_id

Definition at line 90 of file base.c.

◆ attr_eap_type

fr_dict_attr_t const* attr_eap_type

Definition at line 92 of file base.c.

◆ attr_framed_mtu

fr_dict_attr_t const* attr_framed_mtu

Definition at line 99 of file base.c.

◆ attr_freeradius_proxied_to

fr_dict_attr_t const* attr_freeradius_proxied_to

Definition at line 100 of file base.c.

◆ attr_message_authenticator

fr_dict_attr_t const* attr_message_authenticator

Definition at line 94 of file base.c.

◆ attr_ms_mppe_recv_key

fr_dict_attr_t const* attr_ms_mppe_recv_key

Definition at line 102 of file base.c.

◆ attr_ms_mppe_send_key

fr_dict_attr_t const* attr_ms_mppe_send_key

Definition at line 101 of file base.c.

◆ attr_packet_type

fr_dict_attr_t const* attr_packet_type

Definition at line 93 of file base.c.

◆ attr_state

fr_dict_attr_t const* attr_state

Definition at line 103 of file base.c.

◆ attr_tls_max_version

fr_dict_attr_t const* attr_tls_max_version

Definition at line 106 of file base.c.

◆ attr_tls_min_version

fr_dict_attr_t const* attr_tls_min_version

Definition at line 105 of file base.c.

◆ attr_user_name

fr_dict_attr_t const* attr_user_name

Definition at line 104 of file base.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius

Definition at line 77 of file base.c.

◆ dict_radius

fr_dict_t const* dict_radius

Definition at line 78 of file base.c.

◆ dict_tls

fr_dict_t const* dict_tls

Definition at line 79 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" },
{ .out = &dict_tls, .proto = "tls" },
{ NULL }
}
static fr_dict_t const * dict_freeradius
Definition base.c:37
fr_dict_t const * dict_tls
Definition base.c:79
fr_dict_t const * dict_radius
Definition base.c:78

Definition at line 82 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_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .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_framed_mtu, .name = "Framed-MTU", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .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 },
{ .out = &attr_tls_min_version, .name = "Min-Version", .type = FR_TYPE_FLOAT32, .dict = &dict_tls },
{ .out = &attr_tls_max_version, .name = "Max-Version", .type = FR_TYPE_FLOAT32, .dict = &dict_tls },
{ NULL }
}
fr_dict_attr_t const * attr_packet_type
Definition base.c:93
fr_dict_attr_t const * attr_eap_session_id
Definition base.c:90
fr_dict_attr_t const * attr_state
Definition base.c:103
fr_dict_attr_t const * attr_eap_identity
Definition base.c:91
fr_dict_attr_t const * attr_freeradius_proxied_to
Definition base.c:100
fr_dict_attr_t const * attr_chbind_response_code
Definition base.c:89
fr_dict_attr_t const * attr_eap_message
Definition base.c:96
fr_dict_attr_t const * attr_eap_type
Definition base.c:92
fr_dict_attr_t const * attr_eap_msk
Definition base.c:97
fr_dict_attr_t const * attr_eap_channel_binding_message
Definition base.c:95
fr_dict_attr_t const * attr_tls_min_version
Definition base.c:105
fr_dict_attr_t const * attr_eap_emsk
Definition base.c:98
fr_dict_attr_t const * attr_ms_mppe_send_key
Definition base.c:101
fr_dict_attr_t const * attr_tls_max_version
Definition base.c:106
fr_dict_attr_t const * attr_user_name
Definition base.c:104
fr_dict_attr_t const * attr_framed_mtu
Definition base.c:99
fr_dict_attr_t const * attr_ms_mppe_recv_key
Definition base.c:102
fr_dict_attr_t const * attr_message_authenticator
Definition base.c:94
@ FR_TYPE_FLOAT32
Single precision floating point.
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_OCTETS
Raw octets.

Definition at line 109 of file base.c.