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

Macros

#define ipset_print_portnum   ipset_print_number
 

Typedefs

typedef int(* ipset_printfn )(char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 

Functions

int ipset_print_ether (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_ether - print ethernet address to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_family (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_family - print INET family : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_type (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_type - print ipset type string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_ip (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_ip - print IPv4|IPv6 address to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_ipaddr (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_ipaddr - print IPv4|IPv6 address to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_number (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_number - print number to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_name (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_name - print setname element string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_port (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_port - print port or port range : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_mark (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_mark - print mark to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_iface (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_iface - print interface element string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_comment (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_comment - print arbitrary parameter string : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_skbmark (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 
int ipset_print_skbprio (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 
int ipset_print_proto (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_proto - print protocol name : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_icmp (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_icmp - print ICMP code name or type/code : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_icmpv6 (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_icmpv6 - print ICMPv6 code name or type/code : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_proto_port (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_proto_port - print proto:port : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_flag (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 
int ipset_print_elem (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_elem - print ADT elem according to settype : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 
int ipset_print_data (char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)
 ipset_print_data - print data, generic fuction : printing buffer : length of available buffer space : data blob : the option kind : environment flags More...
 

Macro Definition Documentation

#define ipset_print_portnum   ipset_print_number

Typedef Documentation

typedef int(* ipset_printfn)(char *buf, unsigned int len, const struct ipset_data *data, enum ipset_opt opt, uint8_t env)

Function Documentation

int ipset_print_comment ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t env  UNUSED 
)

ipset_print_comment - print arbitrary parameter string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print arbitrary string to output buffer.

Return length of printed string or error size.

References ipset_data_get(), IPSET_OPT_ADT_COMMENT, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_data ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t  env 
)

ipset_print_data - print data, generic fuction : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Generic wrapper of the printing functions.

Return lenght of printed string or error size.

References ipset_data_setname(), IPSET_OPT_ELEM, IPSET_OPT_ELEMENTS, IPSET_OPT_FAMILY, IPSET_OPT_GC, IPSET_OPT_HASHSIZE, IPSET_OPT_IFACE, IPSET_OPT_IP, IPSET_OPT_MARKMASK, IPSET_OPT_MAXELEM, IPSET_OPT_NETMASK, IPSET_OPT_PORT, IPSET_OPT_PROBES, IPSET_OPT_REFERENCES, IPSET_OPT_RESIZE, IPSET_OPT_SIZE, IPSET_OPT_TIMEOUT, IPSET_OPT_TYPE, ipset_print_elem(), ipset_print_family(), ipset_print_iface(), ipset_print_ip(), ipset_print_number(), ipset_print_port(), ipset_print_type(), IPSET_SETNAME, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_elem ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  UNUSED,
uint8_t  env 
)

ipset_print_elem - print ADT elem according to settype : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print (multipart) element according to settype

Return lenght of printed string or error size.

References ipset_type::dimension, ipset_type::elem, IF_D, ipset_data_get(), IPSET_DIM_ONE, IPSET_DIM_THREE, IPSET_DIM_TWO, IPSET_ELEM_SEPARATOR, IPSET_OPT_TYPE, ipset_type::last_elem_optional, ipset_elem::opt, ipset_elem::print, size, SNPRINTF_FAILURE, and type.

Referenced by ipset_print_data().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_ether ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t env  UNUSED 
)

ipset_print_ether - print ethernet address to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print Ethernet address to output buffer.

Return lenght of printed string or error size.

References ETH_ALEN, ether, ipset_data_get(), IPSET_OPT_ETHER, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_family ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_family - print INET family : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print INET family string to output buffer.

Return lenght of printed string or error size.

References ipset_data_family(), IPSET_OPT_FAMILY, and opt.

Referenced by ipset_print_data().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_flag ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t  env 
)
int ipset_print_icmp ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_icmp - print ICMP code name or type/code : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print ICMP code name or type/code name to output buffer.

Return lenght of printed string or error size.

References icmp_to_name(), ipset_data_get(), IPSET_OPT_PORT, name, NULL, and opt.

Referenced by ipset_print_proto_port().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_icmpv6 ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_icmpv6 - print ICMPv6 code name or type/code : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print ICMPv6 code name or type/code name to output buffer.

Return lenght of printed string or error size.

References icmpv6_to_name(), ipset_data_get(), IPSET_OPT_PORT, name, NULL, and opt.

Referenced by ipset_print_proto_port().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_iface ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t env  UNUSED 
)

ipset_print_iface - print interface element string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print interface element string to output buffer.

Return lenght of printed string or error size.

References IFNAMSIZ, ipset_data_get(), IPSET_OPT_IFACE, IPSET_OPT_PHYSDEV, name, size, and SNPRINTF_FAILURE.

Referenced by ipset_print_data().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_ip ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t  env 
)

ipset_print_ip - print IPv4|IPv6 address to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print IPv4|IPv6 address, address/cidr or address range to output buffer.

Return lenght of printed string or error size.

References D, flags, nf_inet_addr::ip, ipset_data_family(), ipset_data_get(), IPSET_ENV_RESOLVE, IPSET_OPT_CIDR, IPSET_OPT_CIDR2, IPSET_OPT_IP, IPSET_OPT_IP2, IPSET_OPT_IP_TO, IPSET_RANGE_SEPARATOR, NFPROTO_IPV4, NFPROTO_IPV6, size, and SNPRINTF_FAILURE.

Referenced by ipset_print_data().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_ipaddr ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t  env 
)

ipset_print_ipaddr - print IPv4|IPv6 address to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print IPv4|IPv6 address or address/cidr to output buffer.

Return lenght of printed string or error size.

References flags, nf_inet_addr::ip, ipset_data_family(), ipset_data_get(), IPSET_ENV_RESOLVE, IPSET_OPT_CIDR, IPSET_OPT_CIDR2, IPSET_OPT_IP, IPSET_OPT_IP2, IPSET_OPT_IP_TO, NFPROTO_IPV4, and NFPROTO_IPV6.

Here is the call graph for this function:

int ipset_print_mark ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_mark - print mark to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print mark to output buffer.

Return lenght of printed string or error size.

References ipset_data_get(), IPSET_OPT_MARK, IPSET_OPT_MARKMASK, mark, opt, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_name ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t env  UNUSED 
)

ipset_print_name - print setname element string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print setname element string to output buffer.

Return lenght of printed string or error size.

References ipset_data_flags_test(), ipset_data_get(), IPSET_FLAG, IPSET_FLAG_BEFORE, IPSET_MAXNAMELEN, IPSET_OPT_FLAGS, IPSET_OPT_NAME, IPSET_OPT_NAMEREF, name, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_number ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t env  UNUSED 
)

ipset_print_number - print number to string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print number to output buffer.

Return lenght of printed string or error size.

References D, ipset_data_get(), and ipset_data_sizeof().

Referenced by ipset_print_data().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_port ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_port - print port or port range : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print port or port range to output buffer.

Return lenght of printed string or error size.

References ipset_data_get(), IPSET_OPT_PORT, IPSET_OPT_PORT_TO, IPSET_RANGE_SEPARATOR, opt, size, and SNPRINTF_FAILURE.

Referenced by ipset_print_data(), and ipset_print_proto_port().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_proto ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_proto - print protocol name : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print protocol name to output buffer.

Return lenght of printed string or error size.

References ipset_data_get(), IPSET_OPT_PROTO, and opt.

Referenced by ipset_print_proto_port().

Here is the call graph for this function:

Here is the caller graph for this function:

int ipset_print_proto_port ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt opt  ASSERT_UNUSED,
uint8_t env  UNUSED 
)

ipset_print_proto_port - print proto:port : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print protocol and port to output buffer.

Return lenght of printed string or error size.

References IPPROTO_SCTP, IPPROTO_UDPLITE, ipset_data_flags_test(), ipset_data_get(), IPSET_FLAG, IPSET_OPT_PORT, IPSET_OPT_PROTO, ipset_print_icmp(), ipset_print_icmpv6(), ipset_print_port(), ipset_print_proto(), IPSET_PROTO_SEPARATOR, opt, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_skbmark ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t  env 
)

References ipset_data_get(), IPSET_OPT_SKBMARK, mark, mask, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_skbprio ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t  env 
)

References ipset_data_get(), IPSET_OPT_SKBPRIO, size, and SNPRINTF_FAILURE.

Here is the call graph for this function:

int ipset_print_type ( char *  buf,
unsigned int  len,
const struct ipset_data data,
enum ipset_opt  opt,
uint8_t env  UNUSED 
)

ipset_print_type - print ipset type string : printing buffer : length of available buffer space : data blob : the option kind : environment flags

Print ipset module string identifier to output buffer.

Return lenght of printed string or error size.

References ipset_data_get(), IPSET_OPT_TYPE, ipset_type::name, and type.

Referenced by ipset_print_data().

Here is the call graph for this function:

Here is the caller graph for this function: