FreeBSD kernel netgraph code
ng_patch.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  ng_patch_op_val
 
struct  ng_patch_op
 
struct  ng_patch_config
 
struct  ng_patch_stats
 
struct  ng_patch_vlan_header
 

Macros

#define NG_PATCH_NODE_TYPE   "patch"
 
#define NGM_PATCH_COOKIE   1262445509
 
#define NG_PATCH_HOOK_IN   "in"
 
#define NG_PATCH_HOOK_OUT   "out"
 
#define NG_PATCH_CSUM_IPV4   (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP)
 
#define NG_PATCH_CSUM_IPV6   (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6)
 
#define NG_PATCH_CONFIG_TYPE
 
#define NG_PATCH_OP_TYPE
 
#define NG_PATCH_STATS_TYPE
 
#define NG_PATCH_CONF_SIZE(count)
 

Enumerations

enum  {
  NGM_PATCH_SETCONFIG = 1 , NGM_PATCH_GETCONFIG , NGM_PATCH_GET_STATS , NGM_PATCH_CLR_STATS ,
  NGM_PATCH_GETCLR_STATS , NGM_PATCH_GETDLT , NGM_PATCH_SETDLT
}
 
enum  {
  NG_PATCH_MODE_SET = 1 , NG_PATCH_MODE_ADD = 2 , NG_PATCH_MODE_SUB = 3 , NG_PATCH_MODE_MUL = 4 ,
  NG_PATCH_MODE_DIV = 5 , NG_PATCH_MODE_NEG = 6 , NG_PATCH_MODE_AND = 7 , NG_PATCH_MODE_OR = 8 ,
  NG_PATCH_MODE_XOR = 9 , NG_PATCH_MODE_SHL = 10 , NG_PATCH_MODE_SHR = 11
}
 

Macro Definition Documentation

◆ NG_PATCH_CONF_SIZE

#define NG_PATCH_CONF_SIZE (   count)
Value:
(sizeof(struct ng_patch_config) + \
(count) * sizeof(struct ng_patch_op))
uint16_t count
Definition: netflow.h:1

Definition at line 132 of file ng_patch.h.

◆ NG_PATCH_CONFIG_TYPE

#define NG_PATCH_CONFIG_TYPE
Value:
{ \
{ "count", &ng_parse_uint32_type }, \
{ "csum_flags", &ng_parse_uint64_type }, \
{ "relative_offset", &ng_parse_uint32_type }, \
{ "ops", &ng_patch_ops_array_type }, \
{ NULL } \
}
const struct ng_parse_type ng_parse_uint64_type
Definition: ng_parse.c:703
const struct ng_parse_type ng_parse_uint32_type
Definition: ng_parse.c:608
static const struct ng_parse_type ng_patch_ops_array_type
Definition: ng_patch.c:93

Definition at line 77 of file ng_patch.h.

◆ NG_PATCH_CSUM_IPV4

#define NG_PATCH_CSUM_IPV4   (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP)

Definition at line 46 of file ng_patch.h.

◆ NG_PATCH_CSUM_IPV6

#define NG_PATCH_CSUM_IPV6   (CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6)

Definition at line 47 of file ng_patch.h.

◆ NG_PATCH_HOOK_IN

#define NG_PATCH_HOOK_IN   "in"

Definition at line 42 of file ng_patch.h.

◆ NG_PATCH_HOOK_OUT

#define NG_PATCH_HOOK_OUT   "out"

Definition at line 43 of file ng_patch.h.

◆ NG_PATCH_NODE_TYPE

#define NG_PATCH_NODE_TYPE   "patch"

Definition at line 36 of file ng_patch.h.

◆ NG_PATCH_OP_TYPE

#define NG_PATCH_OP_TYPE
Value:
{ \
{ "offset", &ng_parse_uint32_type }, \
{ "length", &ng_parse_uint16_type }, \
{ "mode", &ng_parse_uint16_type }, \
{ "value", &ng_parse_uint64_type }, \
{ NULL } \
}
const struct ng_parse_type ng_parse_uint16_type
Definition: ng_parse.c:509

Definition at line 85 of file ng_patch.h.

◆ NG_PATCH_STATS_TYPE

#define NG_PATCH_STATS_TYPE
Value:
{ \
{ "Received", &ng_parse_uint64_type }, \
{ "Patched", &ng_parse_uint64_type }, \
{ "Dropped", &ng_parse_uint64_type }, \
{ NULL } \
}

Definition at line 93 of file ng_patch.h.

◆ NGM_PATCH_COOKIE

#define NGM_PATCH_COOKIE   1262445509

Definition at line 39 of file ng_patch.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NGM_PATCH_SETCONFIG 
NGM_PATCH_GETCONFIG 
NGM_PATCH_GET_STATS 
NGM_PATCH_CLR_STATS 
NGM_PATCH_GETCLR_STATS 
NGM_PATCH_GETDLT 
NGM_PATCH_SETDLT 

Definition at line 50 of file ng_patch.h.

◆ anonymous enum

anonymous enum
Enumerator
NG_PATCH_MODE_SET 
NG_PATCH_MODE_ADD 
NG_PATCH_MODE_SUB 
NG_PATCH_MODE_MUL 
NG_PATCH_MODE_DIV 
NG_PATCH_MODE_NEG 
NG_PATCH_MODE_AND 
NG_PATCH_MODE_OR 
NG_PATCH_MODE_XOR 
NG_PATCH_MODE_SHL 
NG_PATCH_MODE_SHR 

Definition at line 61 of file ng_patch.h.