netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
utils.c File Reference
#include <internal.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <arpa/inet.h>
#include <errno.h>
#include <inttypes.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
Include dependency graph for utils.c:

Functions

const char * nft_family2str (uint32_t family)
 
int nft_str2family (const char *family)
 
int nft_get_value (enum nft_type type, void *val, void *out)
 
int nft_strtoi (const char *string, int base, void *out, enum nft_type type)
 
const char * nft_verdict2str (uint32_t verdict)
 
int nft_str2verdict (const char *verdict, int *verdict_num)
 
int nft_fprintf (FILE *fp, void *obj, uint32_t type, uint32_t flags, int(*snprintf_cb)(char *buf, size_t bufsiz, void *obj, uint32_t type, uint32_t flags))
 
void __nft_assert_fail (uint16_t attr, const char *filename, int line)
 
void __noreturn __abi_breakage (const char *file, int line, const char *reason)
 

Function Documentation

void __noreturn __abi_breakage ( const char *  file,
int  line,
const char *  reason 
)
void __nft_assert_fail ( uint16_t  attr,
const char *  filename,
int  line 
)
const char* nft_family2str ( uint32_t  family)

References NULL.

int nft_fprintf ( FILE *  fp,
void *  obj,
uint32_t  type,
uint32_t  flags,
int(*)(char *buf, size_t bufsiz, void *obj, uint32_t type, uint32_t flags snprintf_cb 
)

References NFT_SNPRINTF_BUFSIZ, NULL, and xfree().

Referenced by nft_chain_fprintf(), nft_event_footer_fprintf(), nft_event_header_fprintf(), nft_gen_fprintf(), nft_rule_fprintf(), nft_set_elem_fprintf(), nft_set_fprintf(), and nft_table_fprintf().

Here is the call graph for this function:

Here is the caller graph for this function:

int nft_get_value ( enum nft_type  type,
void *  val,
void *  out 
)

References len, max, min, NFT_TYPE_S16, NFT_TYPE_S32, NFT_TYPE_S64, NFT_TYPE_S8, NFT_TYPE_U16, NFT_TYPE_U32, NFT_TYPE_U64, NFT_TYPE_U8, and type.

Referenced by nft_strtoi().

Here is the caller graph for this function:

int nft_str2family ( const char *  family)

References NFPROTO_NUMPROTO, and NULL.

int nft_str2verdict ( const char *  verdict,
int *  verdict_num 
)
int nft_strtoi ( const char *  string,
int  base,
void *  out,
enum nft_type  type 
)

References nft_get_value(), NFT_TYPE_S16, NFT_TYPE_S32, NFT_TYPE_S64, NFT_TYPE_S8, NFT_TYPE_U16, NFT_TYPE_U32, NFT_TYPE_U64, and NFT_TYPE_U8.

Here is the call graph for this function:

const char* nft_verdict2str ( uint32_t  verdict)

Variable Documentation

int len

Referenced by __attribute__(), __snprintf_connlabels(), channel_send(), constant_expr_join(), constant_expr_splice(), expr_alloc(), exthdr_init_raw(), get_cmp_data(), interval_map_decompose(), ipset_load_types(), ipset_match_cmd(), ipset_parse_ether(), local_client_create(), local_server_create(), main(), mnl_attr_put(), mnl_nlmsg_fprintf(), mnl_nlmsg_put_extra_header(), mnl_nlmsg_put_header(), mpz_out_str(), mpz_printf(), mpz_switch_byteorder(), msg2ct(), msg2exp(), msgb_burp(), msgb_pull(), msgb_put(), multichannel_open(), nethdr_size(), netlink_delinearize_rule(), netlink_gen_raw_data(), nfct_parse_conntrack(), nfct_set_attr_l(), nfexp_parse_expect(), nflog_snprintf_xml(), nfnl_addattr_l(), nfnl_dump_packet(), nfnl_handle_packet(), nfnl_iterator_create(), nfnl_listen(), nfnl_log_msg_set_hwaddr(), nfnl_log_msg_set_payload(), nfnl_nfa_addattr_l(), nfnl_nft_bitwise_set_len(), nfnl_nft_byteorder_set_len(), nfnl_nft_exthdr_set_len(), nfnl_nft_payload_set_len(), nfnl_nft_set_set_datalen(), nfnl_nft_set_set_keylen(), nfnl_parse_attr(), nfnl_queue_msg_set_hwaddr(), nfnl_queue_msg_set_payload(), nfnl_talk(), nfq_checksum_tcpudp_ipv4(), nfq_checksum_tcpudp_ipv6(), nfq_snprintf_xml(), nfq_tcp_get_payload(), nfq_tcp_snprintf(), nfq_udp_get_payload(), nft_gen_snprintf(), nft_get_value(), nft_parse_bitwise(), nft_rule_expr_snprintf(), nft_ruleset_fprintf(), nft_table_snprintf(), nl_addr_set_binary_addr(), nla_strcmp(), nla_strlcpy(), nlmsg_reserve(), parse_meta(), payload_init_raw(), pktb_alloc(), pktb_pull(), pktb_push(), pktb_put(), pktb_trim(), printpkt_print(), rtnl_ematch_alloc(), rtnl_ematch_parse(), rtnl_neightbl_set_proxy_queue_len(), rtnl_neightbl_set_queue_len(), rtnl_rule_set_dst_len(), rtnl_rule_set_src_len(), iptables-test::run_test(), iptables-test::run_test_file(), xtables_ip6parse_multiple(), and xtables_ipparse_multiple().