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

BIO abstractions for HA proxy protocol interceptors. More...

#include <freeradius-devel/bio/bio_priv.h>
#include <freeradius-devel/bio/null.h>
#include <freeradius-devel/bio/buf.h>
#include <freeradius-devel/bio/haproxy.h>
+ Include dependency graph for haproxy.c:

Go to the source code of this file.

Data Structures

struct  fr_bio_haproxy_t
 The haproxy bio. More...
 

Macros

#define HAPROXY_HEADER_V1_SIZE   (108)
 

Functions

fr_bio_tfr_bio_haproxy_alloc (TALLOC_CTX *ctx, fr_bio_cb_funcs_t *cb, fr_bio_t *next)
 Allocate an haproxy bio. More...
 
fr_bio_haproxy_info_t const * fr_bio_haproxy_info (fr_bio_t *bio)
 Get client information from the haproxy bio. More...
 
static ssize_t fr_bio_haproxy_read (fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size)
 Read from the next bio, and determine if we have an haproxy header. More...
 
static ssize_t fr_bio_haproxy_read_next (fr_bio_t *bio, UNUSED void *packet_ctx, void *buffer, size_t size)
 Satisfy reads from the "next" bio. More...
 
static ssize_t fr_bio_haproxy_v1 (fr_bio_haproxy_t *my)
 Parse the haproxy header, version 1. More...
 

Detailed Description

BIO abstractions for HA proxy protocol interceptors.

Id
13be88c2cd32aae609acf1c58b9fc75f23609caf

Definition in file haproxy.c.


Data Structure Documentation

◆ fr_bio_haproxy_t

struct fr_bio_haproxy_t

The haproxy bio.

Definition at line 36 of file haproxy.c.

+ Collaboration diagram for fr_bio_haproxy_t:
Data Fields
bool available is the haxproxy header available and done
fr_bio_buf_t buffer intermediate buffer to read the haproxy header
FR_BIO_COMMON
fr_bio_haproxy_info_t info Information about the "real" client which has connected.

Macro Definition Documentation

◆ HAPROXY_HEADER_V1_SIZE

#define HAPROXY_HEADER_V1_SIZE   (108)

Definition at line 31 of file haproxy.c.

Function Documentation

◆ fr_bio_haproxy_alloc()

fr_bio_t* fr_bio_haproxy_alloc ( TALLOC_CTX *  ctx,
fr_bio_cb_funcs_t cb,
fr_bio_t next 
)

Allocate an haproxy bio.

Definition at line 224 of file haproxy.c.

+ Here is the call graph for this function:

◆ fr_bio_haproxy_info()

fr_bio_haproxy_info_t const* fr_bio_haproxy_info ( fr_bio_t bio)

Get client information from the haproxy bio.

Definition at line 249 of file haproxy.c.

◆ fr_bio_haproxy_read()

static ssize_t fr_bio_haproxy_read ( fr_bio_t bio,
void *  packet_ctx,
void *  buffer,
size_t  size 
)
static

Read from the next bio, and determine if we have an haproxy header.

Definition at line 185 of file haproxy.c.

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

◆ fr_bio_haproxy_read_next()

static ssize_t fr_bio_haproxy_read_next ( fr_bio_t bio,
UNUSED void *  packet_ctx,
void *  buffer,
size_t  size 
)
static

Satisfy reads from the "next" bio.

The caveat is that there may be data left in our buffer which is needed for the application. We can't unchain ourselves until we've returned that data to the application, and emptied our buffer.

Definition at line 151 of file haproxy.c.

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

◆ fr_bio_haproxy_v1()

static ssize_t fr_bio_haproxy_v1 ( fr_bio_haproxy_t my)
static

Parse the haproxy header, version 1.

Definition at line 50 of file haproxy.c.

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