The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
vmps.c File Reference

Functions to send/receive VQP packets. More...

#include <freeradius-devel/io/test_point.h>
#include <freeradius-devel/protocol/vmps/vmps.h>
#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/util/proto.h>
#include <freeradius-devel/util/udp.h>
#include "vmps.h"
#include "attrs.h"
+ Include dependency graph for vmps.c:

Go to the source code of this file.

Data Structures

struct  fr_vmps_ctx_t
 Used as the decoder ctx. More...
 

Functions

static int _decode_test_ctx (UNUSED fr_vmps_ctx_t *proto_ctx)
 
static int _encode_test_ctx (UNUSED fr_vmps_ctx_t *proto_ctx)
 
static int decode_test_ctx (void **out, TALLOC_CTX *ctx)
 
static int encode_test_ctx (void **out, TALLOC_CTX *ctx)
 
int fr_vmps_decode (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, unsigned int *code)
 
static ssize_t fr_vmps_decode_proto (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, void *proto_ctx)
 
ssize_t fr_vmps_encode (fr_dbuff_t *dbuff, uint8_t const *original, int code, uint32_t seq_no, fr_dcursor_t *cursor)
 
static ssize_t fr_vmps_encode_proto (UNUSED TALLOC_CTX *ctx, fr_pair_list_t *vps, uint8_t *data, size_t data_len, UNUSED void *proto_ctx)
 
bool fr_vmps_ok (uint8_t const *packet, size_t *packet_len)
 
ssize_t fr_vmps_packet_size (uint8_t const *data, size_t data_len)
 See how big of a packet is in the buffer. More...
 
void fr_vmps_print_hex (FILE *fp, uint8_t const *packet, size_t packet_len)
 Print a raw VMPS packet as hex. More...
 
static void print_hex_data (uint8_t const *ptr, int attrlen, int depth)
 

Variables

char const * fr_vmps_packet_names [FR_VMPS_CODE_MAX]
 
fr_test_point_proto_decode_t vmps_tp_decode_proto
 
fr_test_point_proto_encode_t vmps_tp_encode_proto
 

Detailed Description

Functions to send/receive VQP packets.

Id
72236c487e6ee6b37baa4ed4ae406b247199f516

Definition in file vmps.c.


Data Structure Documentation

◆ fr_vmps_ctx_t

struct fr_vmps_ctx_t

Used as the decoder ctx.

Definition at line 40 of file vmps.c.

Data Fields
int nothing

Function Documentation

◆ _decode_test_ctx()

static int _decode_test_ctx ( UNUSED fr_vmps_ctx_t proto_ctx)
static

Definition at line 517 of file vmps.c.

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

◆ _encode_test_ctx()

static int _encode_test_ctx ( UNUSED fr_vmps_ctx_t proto_ctx)
static

Definition at line 558 of file vmps.c.

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

◆ decode_test_ctx()

static int decode_test_ctx ( void **  out,
TALLOC_CTX *  ctx 
)
static

Definition at line 524 of file vmps.c.

+ Here is the call graph for this function:

◆ encode_test_ctx()

static int encode_test_ctx ( void **  out,
TALLOC_CTX *  ctx 
)
static

Definition at line 565 of file vmps.c.

+ Here is the call graph for this function:

◆ fr_vmps_decode()

int fr_vmps_decode ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
uint8_t const *  data,
size_t  data_len,
unsigned int *  code 
)

Definition at line 154 of file vmps.c.

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

◆ fr_vmps_decode_proto()

static ssize_t fr_vmps_decode_proto ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
uint8_t const *  data,
size_t  data_len,
void *  proto_ctx 
)
static

Definition at line 511 of file vmps.c.

+ Here is the call graph for this function:

◆ fr_vmps_encode()

ssize_t fr_vmps_encode ( fr_dbuff_t dbuff,
uint8_t const *  original,
int  code,
uint32_t  seq_no,
fr_dcursor_t cursor 
)

Definition at line 267 of file vmps.c.

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

◆ fr_vmps_encode_proto()

static ssize_t fr_vmps_encode_proto ( UNUSED TALLOC_CTX *  ctx,
fr_pair_list_t vps,
uint8_t data,
size_t  data_len,
UNUSED void *  proto_ctx 
)
static

Definition at line 549 of file vmps.c.

+ Here is the call graph for this function:

◆ fr_vmps_ok()

bool fr_vmps_ok ( uint8_t const *  packet,
size_t packet_len 
)

Definition at line 83 of file vmps.c.

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

◆ fr_vmps_packet_size()

ssize_t fr_vmps_packet_size ( uint8_t const *  data,
size_t  data_len 
)

See how big of a packet is in the buffer.

Packet is not 'const * const' because we may update data_len, if there's more data in the UDP packet than in the VMPS packet.

Parameters
datapointer to the packet buffer
data_lenlength of the packet buffer
Returns
<= 0 packet is bad. >0 how much of the data is a packet (can be larger than data_len)

Definition at line 370 of file vmps.c.

+ Here is the call graph for this function:

◆ fr_vmps_print_hex()

void fr_vmps_print_hex ( FILE *  fp,
uint8_t const *  packet,
size_t  packet_len 
)

Print a raw VMPS packet as hex.

Definition at line 462 of file vmps.c.

+ Here is the call graph for this function:

◆ print_hex_data()

static void print_hex_data ( uint8_t const *  ptr,
int  attrlen,
int  depth 
)
static

Definition at line 444 of file vmps.c.

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

Variable Documentation

◆ fr_vmps_packet_names

char const* fr_vmps_packet_names[FR_VMPS_CODE_MAX]
Initial value:
= {
[FR_PACKET_TYPE_VALUE_JOIN_REQUEST] = "Join-Request",
[FR_PACKET_TYPE_VALUE_JOIN_RESPONSE] = "Join-Response",
[FR_PACKET_TYPE_VALUE_RECONFIRM_REQUEST] = "Reconfirm-Request",
[FR_PACKET_TYPE_VALUE_RECONFIRM_RESPONSE] = "Reconfirm-Response",
}

Definition at line 75 of file vmps.c.

◆ vmps_tp_decode_proto

fr_test_point_proto_decode_t vmps_tp_decode_proto
Initial value:
= {
.test_ctx = decode_test_ctx,
}
static ssize_t fr_vmps_decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, void *proto_ctx)
Definition: vmps.c:511
static int decode_test_ctx(void **out, TALLOC_CTX *ctx)
Definition: vmps.c:524

Definition at line 541 of file vmps.c.

◆ vmps_tp_encode_proto

fr_test_point_proto_encode_t vmps_tp_encode_proto
Initial value:
= {
.test_ctx = encode_test_ctx,
}
static int encode_test_ctx(void **out, TALLOC_CTX *ctx)
Definition: vmps.c:565
static ssize_t fr_vmps_encode_proto(UNUSED TALLOC_CTX *ctx, fr_pair_list_t *vps, uint8_t *data, size_t data_len, UNUSED void *proto_ctx)
Definition: vmps.c:549

Definition at line 582 of file vmps.c.