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
cadd09910a18e6a496a7e905c91acd7a2668af9d

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 523 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 564 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 530 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 571 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 517 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 271 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 555 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 376 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 468 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 450 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:517
static int decode_test_ctx(void **out, TALLOC_CTX *ctx)
Definition: vmps.c:530

Definition at line 547 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:571
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:555

Definition at line 588 of file vmps.c.