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

Functions to decode TFTP packets. More...

#include <freeradius-devel/util/udp.h>
#include <freeradius-devel/io/test_point.h>
#include "tftp.h"
#include "attrs.h"
+ Include dependency graph for decode.c:

Go to the source code of this file.

Data Structures

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

Functions

static int _decode_test_ctx (UNUSED fr_tftp_ctx_t *proto_ctx)
 
static int decode_test_ctx (void **out, TALLOC_CTX *ctx)
 
int fr_tftp_decode (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len)
 
static ssize_t fr_tftp_decode_proto (TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, UNUSED void *proto_ctx)
 

Variables

fr_test_point_proto_decode_t tftp_tp_decode_proto
 

Detailed Description

Functions to decode TFTP packets.

Id
106a0161b95d8eda0f0ec116748046c932ff947e
Author
Jorge Pereira jpere.nosp@m.ira@.nosp@m.freer.nosp@m.adiu.nosp@m.s.org

Definition in file decode.c.


Data Structure Documentation

◆ fr_tftp_ctx_t

struct fr_tftp_ctx_t

Used as the decoder ctx.

Used as the encoder ctx.

Definition at line 275 of file decode.c.

Data Fields
int nothing

Function Documentation

◆ _decode_test_ctx()

static int _decode_test_ctx ( UNUSED fr_tftp_ctx_t proto_ctx)
static

Definition at line 288 of file decode.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 295 of file decode.c.

+ Here is the call graph for this function:

◆ fr_tftp_decode()

int fr_tftp_decode ( TALLOC_CTX *  ctx,
fr_pair_list_t out,
uint8_t const *  data,
size_t  data_len 
)

2 bytes 2 bytes

| Opcode | Block # |

Figure 5-3: ACK packet

2 bytes 2 bytes string 1 byte

| Opcode | ErrorCode | ErrMsg | 0 |

Figure 5-4: ERROR packet

Definition at line 74 of file decode.c.

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

◆ fr_tftp_decode_proto()

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

Definition at line 282 of file decode.c.

+ Here is the call graph for this function:

Variable Documentation

◆ tftp_tp_decode_proto

fr_test_point_proto_decode_t tftp_tp_decode_proto
Initial value:
= {
.test_ctx = decode_test_ctx,
}
static ssize_t fr_tftp_decode_proto(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data, size_t data_len, UNUSED void *proto_ctx)
Definition: decode.c:282
static int decode_test_ctx(void **out, TALLOC_CTX *ctx)
Definition: decode.c:295

Definition at line 312 of file decode.c.