netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
buffer.h File Reference
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for buffer.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  nft_buf
 

Macros

#define NFT_BUF_INIT(__b, __buf, __len)
 
#define BASE   "base"
 
#define BYTES   "bytes"
 
#define CHAIN   "chain"
 
#define CODE   "code"
 
#define DATA   "data"
 
#define DIR   "dir"
 
#define DREG   "dreg"
 
#define EXTHDR_TYPE   "exthdr_type"
 
#define FAMILY   "family"
 
#define FLAGS   "flags"
 
#define GROUP   "group"
 
#define HANDLE   "handle"
 
#define HOOKNUM   "hooknum"
 
#define KEY   "key"
 
#define LEN   "len"
 
#define LEVEL   "level"
 
#define MASK   "mask"
 
#define NAT_TYPE   "nat_type"
 
#define NAME   "name"
 
#define NUM   "num"
 
#define OFFSET   "offset"
 
#define OP   "op"
 
#define PACKETS   "packets"
 
#define PKTS   "pkts"
 
#define POLICY   "policy"
 
#define PREFIX   "prefix"
 
#define PRIO   "prio"
 
#define QTHRESH   "qthreshold"
 
#define RATE   "rate"
 
#define SET   "set"
 
#define SIZE   "size"
 
#define SNAPLEN   "snaplen"
 
#define SREG_ADDR_MAX   "sreg_addr_max"
 
#define SREG_ADDR_MIN   "sreg_addr_min"
 
#define SREG_PROTO_MAX   "sreg_proto_max"
 
#define SREG_PROTO_MIN   "sreg_proto_min"
 
#define SREG   "sreg"
 
#define TABLE   "table"
 
#define TOTAL   "total"
 
#define TYPE   "type"
 
#define UNIT   "unit"
 
#define USE   "use"
 
#define XOR   "xor"
 

Functions

int nft_buf_update (struct nft_buf *b, int ret)
 
int nft_buf_done (struct nft_buf *b)
 
int nft_buf_open (struct nft_buf *b, int type, const char *tag)
 
int nft_buf_close (struct nft_buf *b, int type, const char *tag)
 
int nft_buf_u32 (struct nft_buf *b, int type, uint32_t value, const char *tag)
 
int nft_buf_s32 (struct nft_buf *b, int type, uint32_t value, const char *tag)
 
int nft_buf_u64 (struct nft_buf *b, int type, uint64_t value, const char *tag)
 
int nft_buf_str (struct nft_buf *b, int type, const char *str, const char *tag)
 
int nft_buf_reg (struct nft_buf *b, int type, union nft_data_reg *reg, int reg_type, const char *tag)
 

Macro Definition Documentation

#define BASE   "base"
#define BYTES   "bytes"
#define CHAIN   "chain"
#define CODE   "code"
#define DATA   "data"
#define DIR   "dir"
#define DREG   "dreg"
#define EXTHDR_TYPE   "exthdr_type"
#define FAMILY   "family"
#define FLAGS   "flags"

Referenced by rtnl_route_nh_compare().

#define GROUP   "group"
#define HANDLE   "handle"
#define HOOKNUM   "hooknum"
#define KEY   "key"
#define LEN   "len"
#define LEVEL   "level"
#define MASK   "mask"
#define NAME   "name"
#define NAT_TYPE   "nat_type"
#define NFT_BUF_INIT (   __b,
  __buf,
  __len 
)
Value:
struct nft_buf __b = { \
.buf = __buf, \
.len = __len, \
};
char * buf
Definition: buffer.h:8
Definition: buffer.h:7
#define NUM   "num"
#define OFFSET   "offset"
#define OP   "op"
#define PACKETS   "packets"
#define PKTS   "pkts"
#define POLICY   "policy"
#define PREFIX   "prefix"
#define PRIO   "prio"
#define QTHRESH   "qthreshold"
#define RATE   "rate"
#define SET   "set"
#define SIZE   "size"
#define SNAPLEN   "snaplen"
#define SREG   "sreg"
#define SREG_ADDR_MAX   "sreg_addr_max"
#define SREG_ADDR_MIN   "sreg_addr_min"
#define SREG_PROTO_MAX   "sreg_proto_max"
#define SREG_PROTO_MIN   "sreg_proto_min"
#define TABLE   "table"
#define TOTAL   "total"
#define TYPE   "type"
#define UNIT   "unit"
#define USE   "use"
#define XOR   "xor"

Function Documentation

int nft_buf_close ( struct nft_buf b,
int  type,
const char *  tag 
)
int nft_buf_done ( struct nft_buf b)
int nft_buf_open ( struct nft_buf b,
int  type,
const char *  tag 
)

References NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.

int nft_buf_reg ( struct nft_buf b,
int  type,
union nft_data_reg reg,
int  reg_type,
const char *  tag 
)

References nft_buf::buf, nft_buf::len, nft_buf_update(), nft_data_reg_snprintf(), NFT_OUTPUT_JSON, NFT_OUTPUT_XML, and nft_buf::off.

Here is the call graph for this function:

int nft_buf_s32 ( struct nft_buf b,
int  type,
uint32_t  value,
const char *  tag 
)

References NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.

int nft_buf_str ( struct nft_buf b,
int  type,
const char *  str,
const char *  tag 
)

References NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.

int nft_buf_u32 ( struct nft_buf b,
int  type,
uint32_t  value,
const char *  tag 
)

References NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.

int nft_buf_u64 ( struct nft_buf b,
int  type,
uint64_t  value,
const char *  tag 
)

References NFT_OUTPUT_JSON, and NFT_OUTPUT_XML.

int nft_buf_update ( struct nft_buf b,
int  ret 
)

References nft_buf::fail, nft_buf::len, nft_buf::off, and nft_buf::size.

Referenced by nft_buf_reg().

Here is the caller graph for this function: