#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <net/if_arp.h>
#include <arpa/inet.h>
#include <linux/netfilter.h>
#include <expression.h>
#include <headers.h>
#include <proto.h>
#include <gmputil.h>
#include <utils.h>
#include <netinet/ip_icmp.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>
#include <netinet/ip.h>
#include <netinet/icmp6.h>
#include <net/ethernet.h>
Macros | |
#define | HDR_TEMPLATE(__name, __dtype, __type, __member) |
#define | HDR_FIELD(__name, __struct, __member) HDR_TEMPLATE(__name, &integer_type, __struct, __member) |
#define | HDR_BITFIELD(__name, __dtype,__offset, __len) |
#define | HDR_TYPE(__name, __dtype, __struct, __member) HDR_TEMPLATE(__name, __dtype, __struct, __member) |
#define | INET_PROTOCOL(__name, __struct, __member) HDR_TYPE(__name, &inet_protocol_type, __struct, __member) |
#define | INET_SERVICE(__name, __struct, __member) HDR_TYPE(__name, &inet_service_type, __struct, __member) |
#define | AHHDR_FIELD(__name, __member) HDR_FIELD(__name, struct ip_auth_hdr, __member) |
#define | ESPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct ip_esp_hdr, __member) |
#define | COMPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct ip_comp_hdr, __member) |
#define | ICMPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct icmphdr, __member) |
#define | ICMPHDR_TYPE(__name, __type, __member) HDR_TYPE(__name, __type, struct icmphdr, __member) |
#define | UDPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct udphdr, __member) |
#define | TCPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct tcphdr, __member) |
#define | DCCPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct dccp_hdr, __member) |
#define | SCTPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct sctphdr, __member) |
#define | IPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct iphdr, __member) |
#define | IPHDR_ADDR(__name, __member) HDR_TYPE(__name, &ipaddr_type, struct iphdr, __member) |
#define | ICMP6HDR_FIELD(__name, __member) HDR_FIELD(__name, struct icmp6_hdr, __member) |
#define | ICMP6HDR_TYPE(__name, __type, __member) HDR_TYPE(__name, __type, struct icmp6_hdr, __member) |
#define | IP6HDR_FIELD(__name,__member) HDR_FIELD(__name, struct ipv6hdr, __member) |
#define | IP6HDR_ADDR(__name, __member) HDR_TYPE(__name, &ip6addr_type, struct ipv6hdr, __member) |
#define | IP6HDR_PROTOCOL(__name, __member) HDR_TYPE(__name, &inet_service_type, struct ipv6hdr, __member) |
#define | ARPHDR_TYPE(__name, __type, __member) HDR_TYPE(__name, __type, struct arphdr, __member) |
#define | ARPHDR_FIELD(__name, __member) HDR_FIELD(__name, struct arphdr, __member) |
#define | VLANHDR_BITFIELD(__name, __offset, __len) HDR_BITFIELD(__name, &integer_type, __offset, __len) |
#define | VLANHDR_TYPE(__name, __type, __member) HDR_TYPE(__name, __type, struct vlan_hdr, __member) |
#define | ETHHDR_TEMPLATE(__name, __dtype, __member) HDR_TEMPLATE(__name, __dtype, struct ether_header, __member) |
#define | ETHHDR_TYPE(__name, __member) ETHHDR_TEMPLATE(__name, ðertype_type, __member) |
#define | ETHHDR_ADDR(__name, __member) |
Functions | |
const struct proto_desc * | proto_find_upper (const struct proto_desc *base, unsigned int num) |
proto_find_upper - find higher layer protocol description by protocol value linking it to the lower layer protocol More... | |
int | proto_find_num (const struct proto_desc *base, const struct proto_desc *desc) |
proto_find_num - return protocol number linking two protocols together More... | |
int | proto_dev_type (const struct proto_desc *desc, uint16_t *res) |
proto_dev_type - return arphrd type linking a device and a protocol together More... | |
const struct proto_desc * | proto_dev_desc (uint16_t type) |
proto_dev_desc - return protocol description for an arphrd type More... | |
void | proto_ctx_init (struct proto_ctx *ctx, unsigned int family) |
proto_ctx_init - initialize protocol context for a given hook family More... | |
void | proto_ctx_update (struct proto_ctx *ctx, enum proto_bases base, const struct location *loc, const struct proto_desc *desc) |
proto_ctx_update: update protocol context for given protocol base More... | |
Variables | |
const char * | proto_base_names [] |
const char * | proto_base_tokens [] |
const struct proto_hdr_template | proto_unknown_template |
const struct proto_desc | proto_unknown |
const struct hook_proto_desc | hook_proto_desc [] |
const struct proto_desc | proto_ah |
const struct proto_desc | proto_esp |
const struct proto_desc | proto_comp |
const struct proto_desc | proto_icmp |
const struct proto_desc | proto_udp |
const struct proto_desc | proto_udplite |
const struct proto_desc | proto_tcp |
const struct proto_desc | proto_dccp |
const struct proto_desc | proto_sctp |
const struct proto_desc | proto_ip |
const struct proto_desc | proto_icmp6 |
const struct proto_desc | proto_ip6 |
const struct proto_desc | proto_inet |
const struct proto_desc | proto_inet_service |
const struct proto_desc | proto_arp |
const struct proto_desc | proto_vlan |
const struct datatype | etheraddr_type |
const struct datatype | ethertype_type |
const struct proto_desc | proto_eth |
#define AHHDR_FIELD | ( | __name, | |
__member | |||
) | HDR_FIELD(__name, struct ip_auth_hdr, __member) |
#define COMPHDR_FIELD | ( | __name, | |
__member | |||
) | HDR_FIELD(__name, struct ip_comp_hdr, __member) |
#define ESPHDR_FIELD | ( | __name, | |
__member | |||
) | HDR_FIELD(__name, struct ip_esp_hdr, __member) |
#define ETHHDR_ADDR | ( | __name, | |
__member | |||
) |
#define ETHHDR_TEMPLATE | ( | __name, | |
__dtype, | |||
__member | |||
) | HDR_TEMPLATE(__name, __dtype, struct ether_header, __member) |
#define ETHHDR_TYPE | ( | __name, | |
__member | |||
) | ETHHDR_TEMPLATE(__name, ðertype_type, __member) |
#define HDR_BITFIELD | ( | __name, | |
__dtype, | |||
__offset, | |||
__len | |||
) |
#define HDR_FIELD | ( | __name, | |
__struct, | |||
__member | |||
) | HDR_TEMPLATE(__name, &integer_type, __struct, __member) |
#define HDR_TEMPLATE | ( | __name, | |
__dtype, | |||
__type, | |||
__member | |||
) |
#define HDR_TYPE | ( | __name, | |
__dtype, | |||
__struct, | |||
__member | |||
) | HDR_TEMPLATE(__name, __dtype, __struct, __member) |
#define ICMP6HDR_TYPE | ( | __name, | |
__type, | |||
__member | |||
) | HDR_TYPE(__name, __type, struct icmp6_hdr, __member) |
#define ICMPHDR_TYPE | ( | __name, | |
__type, | |||
__member | |||
) | HDR_TYPE(__name, __type, struct icmphdr, __member) |
#define INET_PROTOCOL | ( | __name, | |
__struct, | |||
__member | |||
) | HDR_TYPE(__name, &inet_protocol_type, __struct, __member) |
#define INET_SERVICE | ( | __name, | |
__struct, | |||
__member | |||
) | HDR_TYPE(__name, &inet_service_type, __struct, __member) |
#define IP6HDR_ADDR | ( | __name, | |
__member | |||
) | HDR_TYPE(__name, &ip6addr_type, struct ipv6hdr, __member) |
#define IP6HDR_PROTOCOL | ( | __name, | |
__member | |||
) | HDR_TYPE(__name, &inet_service_type, struct ipv6hdr, __member) |
#define IPHDR_ADDR | ( | __name, | |
__member | |||
) | HDR_TYPE(__name, &ipaddr_type, struct iphdr, __member) |
#define VLANHDR_BITFIELD | ( | __name, | |
__offset, | |||
__len | |||
) | HDR_BITFIELD(__name, &integer_type, __offset, __len) |
#define VLANHDR_TYPE | ( | __name, | |
__type, | |||
__member | |||
) | HDR_TYPE(__name, __type, struct vlan_hdr, __member) |
proto_ctx_init - initialize protocol context for a given hook family
: protocol context : hook family
References hook_proto_desc::base, hook_proto_desc::desc, proto_ctx::desc, proto_ctx::family, and proto_ctx::protocol.
void proto_ctx_update | ( | struct proto_ctx * | ctx, |
enum proto_bases | base, | ||
const struct location * | loc, | ||
const struct proto_desc * | desc | ||
) |
proto_ctx_update: update protocol context for given protocol base
: protocol context : protocol base : location of the relational expression definiting the context : protocol description for the given layer
References hook_proto_desc::base, hook_proto_desc::desc, proto_ctx::desc, proto_ctx::location, and proto_ctx::protocol.
const struct proto_desc* proto_dev_desc | ( | uint16_t | type | ) |
proto_dev_desc - return protocol description for an arphrd type
: the arphrd type
References array_size, dev_proto_desc::desc, and NULL.
int proto_dev_type | ( | const struct proto_desc * | desc, |
uint16_t * | res | ||
) |
proto_dev_type - return arphrd type linking a device and a protocol together
: the protocol description : pointer to result
References array_size, and dev_proto_desc::type.
Referenced by payload_gen_dependency().
int proto_find_num | ( | const struct proto_desc * | base, |
const struct proto_desc * | desc | ||
) |
proto_find_num - return protocol number linking two protocols together
: lower layer protocol description : upper layer protocol description
References array_size, proto_desc::desc, proto_desc::num, and proto_desc::protocols.
Referenced by payload_gen_dependency().
const struct proto_desc* proto_find_upper | ( | const struct proto_desc * | base, |
unsigned int | num | ||
) |
proto_find_upper - find higher layer protocol description by protocol value linking it to the lower layer protocol
: lower layer protocol description : protocol value
References array_size, proto_desc::desc, NULL, proto_desc::num, and proto_desc::protocols.
const struct hook_proto_desc hook_proto_desc[] |
const struct proto_desc proto_ah |
const struct proto_desc proto_arp |
const char* proto_base_names[] |
Referenced by payload_gen_dependency().
const char* proto_base_tokens[] |
const struct proto_desc proto_comp |
const struct proto_desc proto_dccp |
const struct proto_desc proto_esp |
const struct proto_desc proto_eth |
Referenced by payload_gen_dependency().
const struct proto_desc proto_icmp |
const struct proto_desc proto_icmp6 |
const struct proto_desc proto_inet |
Referenced by payload_gen_dependency().
const struct proto_desc proto_inet_service |
Referenced by payload_gen_dependency().
const struct proto_desc proto_ip |
Referenced by ct_expr_update_type().
const struct proto_desc proto_ip6 |
Referenced by ct_expr_update_type().
const struct proto_desc proto_sctp |
const struct proto_desc proto_tcp |
const struct proto_desc proto_udp |
const struct proto_desc proto_udplite |
const struct proto_desc proto_unknown |
Referenced by payload_expr_alloc().
const struct proto_hdr_template proto_unknown_template |
Referenced by payload_expr_alloc().
const struct proto_desc proto_vlan |