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

Functions to encode TFTP packets. More...

#include <freeradius-devel/util/dbuff.h>
#include <freeradius-devel/util/udp.h>
#include <freeradius-devel/io/test_point.h>
#include "tftp.h"
#include "attrs.h"
+ Include dependency graph for encode.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 _encode_test_ctx (UNUSED fr_tftp_ctx_t *proto_ctx)
 
static int encode_test_ctx (void **out, TALLOC_CTX *ctx)
 
ssize_t fr_tftp_encode (fr_dbuff_t *dbuff, fr_pair_list_t *vps)
 
static ssize_t fr_tftp_encode_proto (UNUSED TALLOC_CTX *ctx, fr_pair_list_t *vps, uint8_t *data, size_t data_len, UNUSED void *proto_ctx)
 

Variables

fr_test_point_proto_encode_t tftp_tp_encode_proto
 

Detailed Description

Functions to encode TFTP packets.

Id
3ade5916865e76eedd14e69087b1fd0885d1d486
Author
Jorge Pereira jpere.nosp@m.ira@.nosp@m.freer.nosp@m.adiu.nosp@m.s.org

Definition in file encode.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

◆ _encode_test_ctx()

static int _encode_test_ctx ( UNUSED fr_tftp_ctx_t proto_ctx)
static

Definition at line 250 of file encode.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 ( void **  out,
TALLOC_CTX *  ctx 
)
static

Definition at line 257 of file encode.c.

+ Here is the call graph for this function:

◆ fr_tftp_encode()

ssize_t fr_tftp_encode ( fr_dbuff_t dbuff,
fr_pair_list_t vps 
)

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 75 of file encode.c.

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

◆ fr_tftp_encode_proto()

static ssize_t fr_tftp_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 245 of file encode.c.

+ Here is the call graph for this function:

Variable Documentation

◆ tftp_tp_encode_proto

fr_test_point_proto_encode_t tftp_tp_encode_proto
Initial value:
= {
.test_ctx = encode_test_ctx,
}
static ssize_t fr_tftp_encode_proto(UNUSED TALLOC_CTX *ctx, fr_pair_list_t *vps, uint8_t *data, size_t data_len, UNUSED void *proto_ctx)
Definition: encode.c:245
static int encode_test_ctx(void **out, TALLOC_CTX *ctx)
Definition: encode.c:257

Definition at line 277 of file encode.c.