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

Go to the source code of this file.

Data Structures

struct  ng_parse_type
 
struct  ng_parse_struct_field
 
struct  ng_parse_fixedarray_info
 
struct  ng_parse_array_info
 
struct  ng_parse_fixedstring_info
 

Typedefs

typedef int ng_parse_t(const struct ng_parse_type *type, const char *string, int *off, const u_char *start, u_char *buf, int *buflen)
 
typedef int ng_unparse_t(const struct ng_parse_type *type, const u_char *data, int *off, char *buf, int buflen)
 
typedef int ng_getDefault_t(const struct ng_parse_type *type, const u_char *start, u_char *buf, int *buflen)
 
typedef int ng_getAlign_t(const struct ng_parse_type *type)
 
typedef int ng_parse_array_getDefault_t(const struct ng_parse_type *type, int index, const u_char *start, u_char *buf, int *buflen)
 
typedef int ng_parse_array_getLength_t(const struct ng_parse_type *type, const u_char *start, const u_char *buf)
 

Enumerations

enum  ng_parse_token {
  T_LBRACE , T_RBRACE , T_LBRACKET , T_RBRACKET ,
  T_EQUALS , T_STRING , T_ERROR , T_WORD ,
  T_EOF
}
 

Functions

int ng_parse (const struct ng_parse_type *type, const char *string, int *off, u_char *buf, int *buflen)
 
int ng_unparse (const struct ng_parse_type *type, const u_char *data, char *buf, int buflen)
 
int ng_parse_getDefault (const struct ng_parse_type *type, u_char *buf, int *buflen)
 
enum ng_parse_token ng_parse_get_token (const char *s, int *startp, int *lenp)
 
char * ng_get_string_token (const char *s, int *startp, int *lenp, int *slenp)
 
char * ng_encode_string (const char *s, int slen)
 

Variables

const struct ng_parse_type ng_parse_struct_type
 
const struct ng_parse_type ng_parse_fixedarray_type
 
const struct ng_parse_type ng_parse_array_type
 
const struct ng_parse_type ng_parse_string_type
 
const struct ng_parse_type ng_parse_fixedstring_type
 
const struct ng_parse_type ng_parse_sizedstring_type
 
const struct ng_parse_type ng_parse_nodebuf_type
 
const struct ng_parse_type ng_parse_hookbuf_type
 
const struct ng_parse_type ng_parse_pathbuf_type
 
const struct ng_parse_type ng_parse_typebuf_type
 
const struct ng_parse_type ng_parse_cmdbuf_type
 
const struct ng_parse_type ng_parse_int8_type
 
const struct ng_parse_type ng_parse_int16_type
 
const struct ng_parse_type ng_parse_int32_type
 
const struct ng_parse_type ng_parse_int64_type
 
const struct ng_parse_type ng_parse_uint8_type
 
const struct ng_parse_type ng_parse_uint16_type
 
const struct ng_parse_type ng_parse_uint32_type
 
const struct ng_parse_type ng_parse_uint64_type
 
const struct ng_parse_type ng_parse_hint8_type
 
const struct ng_parse_type ng_parse_hint16_type
 
const struct ng_parse_type ng_parse_hint32_type
 
const struct ng_parse_type ng_parse_hint64_type
 
const struct ng_parse_type ng_parse_ipaddr_type
 
const struct ng_parse_type ng_parse_enaddr_type
 
const struct ng_parse_type ng_parse_bytearray_type
 
const struct ng_parse_type ng_parse_ng_mesg_type
 

Typedef Documentation

◆ ng_getAlign_t

typedef int ng_getAlign_t(const struct ng_parse_type *type)

Definition at line 260 of file ng_parse.h.

◆ ng_getDefault_t

typedef int ng_getDefault_t(const struct ng_parse_type *type, const u_char *start, u_char *buf, int *buflen)

Definition at line 254 of file ng_parse.h.

◆ ng_parse_array_getDefault_t

typedef int ng_parse_array_getDefault_t(const struct ng_parse_type *type, int index, const u_char *start, u_char *buf, int *buflen)

Definition at line 332 of file ng_parse.h.

◆ ng_parse_array_getLength_t

typedef int ng_parse_array_getLength_t(const struct ng_parse_type *type, const u_char *start, const u_char *buf)

Definition at line 359 of file ng_parse.h.

◆ ng_parse_t

typedef int ng_parse_t(const struct ng_parse_type *type, const char *string, int *off, const u_char *start, u_char *buf, int *buflen)

Definition at line 225 of file ng_parse.h.

◆ ng_unparse_t

typedef int ng_unparse_t(const struct ng_parse_type *type, const u_char *data, int *off, char *buf, int buflen)

Definition at line 240 of file ng_parse.h.

Enumeration Type Documentation

◆ ng_parse_token

Enumerator
T_LBRACE 
T_RBRACE 
T_LBRACKET 
T_RBRACKET 
T_EQUALS 
T_STRING 
T_ERROR 
T_WORD 
T_EOF 

Definition at line 479 of file ng_parse.h.

Function Documentation

◆ ng_encode_string()

char * ng_encode_string ( const char *  s,
int  slen 
)

Definition at line 1816 of file ng_parse.c.

References M_NETGRAPH_PARSE.

Referenced by ng_ksocket_sockaddr_unparse(), ng_sizedstring_unparse(), and ng_string_unparse().

Here is the caller graph for this function:

◆ ng_get_string_token()

char * ng_get_string_token ( const char *  s,
int *  startp,
int *  lenp,
int *  slenp 
)

Definition at line 1728 of file ng_parse.c.

References M_NETGRAPH_PARSE.

Referenced by ng_bytearray_parse(), ng_fixedstring_parse(), ng_ksocket_sockaddr_parse(), ng_parse_get_token(), ng_sizedstring_parse(), and ng_string_parse().

Here is the caller graph for this function:

◆ ng_parse()

int ng_parse ( const struct ng_parse_type type,
const char *  string,
int *  off,
u_char *  buf,
int *  buflen 
)

Definition at line 147 of file ng_parse.c.

References INVOKE, ng_parse_type::parse, and type.

Referenced by ng_generic_msg().

Here is the caller graph for this function:

◆ ng_parse_get_token()

enum ng_parse_token ng_parse_get_token ( const char *  s,
int *  startp,
int *  lenp 
)

Definition at line 1682 of file ng_parse.c.

References M_NETGRAPH_PARSE, ng_get_string_token(), T_EOF, T_EQUALS, T_ERROR, T_LBRACE, T_LBRACKET, T_RBRACE, T_RBRACKET, T_STRING, and T_WORD.

Referenced by ng_ksocket_sockaddr_parse(), ng_parse_composite(), and ng_parse_skip_value().

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

◆ ng_parse_getDefault()

int ng_parse_getDefault ( const struct ng_parse_type type,
u_char *  buf,
int *  buflen 
)

Definition at line 169 of file ng_parse.c.

References ng_parse_type::getDefault, METHOD, and type.

◆ ng_unparse()

int ng_unparse ( const struct ng_parse_type type,
const u_char *  data,
char *  buf,
int  buflen 
)

Definition at line 157 of file ng_parse.c.

References data, INVOKE, type, and ng_parse_type::unparse.

Referenced by ng_generic_msg().

Here is the caller graph for this function:

Variable Documentation

◆ ng_parse_array_type

const struct ng_parse_type ng_parse_array_type
extern

Definition at line 318 of file ng_parse.c.

◆ ng_parse_bytearray_type

const struct ng_parse_type ng_parse_bytearray_type
extern

Definition at line 1153 of file ng_parse.c.

◆ ng_parse_cmdbuf_type

const struct ng_parse_type ng_parse_cmdbuf_type
extern

Definition at line 875 of file ng_parse.c.

◆ ng_parse_enaddr_type

const struct ng_parse_type ng_parse_enaddr_type
extern

Definition at line 1058 of file ng_parse.c.

◆ ng_parse_fixedarray_type

const struct ng_parse_type ng_parse_fixedarray_type
extern

Definition at line 271 of file ng_parse.c.

◆ ng_parse_fixedstring_type

const struct ng_parse_type ng_parse_fixedstring_type
extern

Definition at line 830 of file ng_parse.c.

◆ ng_parse_hint16_type

const struct ng_parse_type ng_parse_hint16_type
extern

Definition at line 514 of file ng_parse.c.

◆ ng_parse_hint32_type

const struct ng_parse_type ng_parse_hint32_type
extern

Definition at line 613 of file ng_parse.c.

◆ ng_parse_hint64_type

const struct ng_parse_type ng_parse_hint64_type
extern

Definition at line 708 of file ng_parse.c.

◆ ng_parse_hint8_type

const struct ng_parse_type ng_parse_hint8_type
extern

Definition at line 418 of file ng_parse.c.

◆ ng_parse_hookbuf_type

const struct ng_parse_type ng_parse_hookbuf_type
extern

Definition at line 851 of file ng_parse.c.

◆ ng_parse_int16_type

const struct ng_parse_type ng_parse_int16_type
extern

Definition at line 499 of file ng_parse.c.

◆ ng_parse_int32_type

const struct ng_parse_type ng_parse_int32_type
extern

Definition at line 598 of file ng_parse.c.

◆ ng_parse_int64_type

const struct ng_parse_type ng_parse_int64_type
extern

Definition at line 693 of file ng_parse.c.

◆ ng_parse_int8_type

const struct ng_parse_type ng_parse_int8_type
extern

Definition at line 403 of file ng_parse.c.

Referenced by ng_ipaddr_parse().

◆ ng_parse_ipaddr_type

const struct ng_parse_type ng_parse_ipaddr_type
extern

Definition at line 1002 of file ng_parse.c.

◆ ng_parse_ng_mesg_type

const struct ng_parse_type ng_parse_ng_mesg_type
extern

Definition at line 1187 of file ng_parse.c.

◆ ng_parse_nodebuf_type

const struct ng_parse_type ng_parse_nodebuf_type
extern

Definition at line 843 of file ng_parse.c.

◆ ng_parse_pathbuf_type

const struct ng_parse_type ng_parse_pathbuf_type
extern

Definition at line 859 of file ng_parse.c.

◆ ng_parse_sizedstring_type

const struct ng_parse_type ng_parse_sizedstring_type
extern

Definition at line 938 of file ng_parse.c.

◆ ng_parse_string_type

const struct ng_parse_type ng_parse_string_type
extern

Definition at line 766 of file ng_parse.c.

◆ ng_parse_struct_type

const struct ng_parse_type ng_parse_struct_type
extern

Definition at line 222 of file ng_parse.c.

◆ ng_parse_typebuf_type

const struct ng_parse_type ng_parse_typebuf_type
extern

Definition at line 867 of file ng_parse.c.

◆ ng_parse_uint16_type

const struct ng_parse_type ng_parse_uint16_type
extern

Definition at line 509 of file ng_parse.c.

◆ ng_parse_uint32_type

const struct ng_parse_type ng_parse_uint32_type
extern

Definition at line 608 of file ng_parse.c.

◆ ng_parse_uint64_type

const struct ng_parse_type ng_parse_uint64_type
extern

Definition at line 703 of file ng_parse.c.

◆ ng_parse_uint8_type

const struct ng_parse_type ng_parse_uint8_type
extern

Definition at line 413 of file ng_parse.c.