#include <stdlib.h>#include <stdio.h>#include <string.h>#include <unistd.h>#include <sys/time.h>#include <sys/types.h>#include <libipq/libipq.h>#include <netinet/in.h>#include <linux/netfilter.h>
Data Structures | |
| struct | ipq_errmap_t |
Macros | |
| #define | IPQ_MAXERR IPQ_ERR_PROTOCOL |
Enumerations | |
| enum | { IPQ_ERR_NONE = 0, IPQ_ERR_IMPL, IPQ_ERR_HANDLE, IPQ_ERR_SOCKET, IPQ_ERR_BIND, IPQ_ERR_BUFFER, IPQ_ERR_RECV, IPQ_ERR_NLEOF, IPQ_ERR_ADDRLEN, IPQ_ERR_STRUNC, IPQ_ERR_RTRUNC, IPQ_ERR_NLRECV, IPQ_ERR_SEND, IPQ_ERR_SUPP, IPQ_ERR_RECVBUF, IPQ_ERR_TIMEOUT, IPQ_ERR_PROTOCOL } |
Functions | |
| struct ipq_handle * | ipq_create_handle (uint32_t flags, uint32_t protocol) |
| int | ipq_destroy_handle (struct ipq_handle *h) |
| int | ipq_set_mode (const struct ipq_handle *h, uint8_t mode, size_t range) |
| ssize_t | ipq_read (const struct ipq_handle *h, unsigned char *buf, size_t len, int timeout) |
| int | ipq_message_type (const unsigned char *buf) |
| int | ipq_get_msgerr (const unsigned char *buf) |
| ipq_packet_msg_t * | ipq_get_packet (const unsigned char *buf) |
| int | ipq_set_verdict (const struct ipq_handle *h, ipq_id_t id, unsigned int verdict, size_t data_len, unsigned char *buf) |
| int | ipq_ctl (const struct ipq_handle *h, int request,...) |
| char * | ipq_errstr (void) |
| void | ipq_perror (const char *s) |
Variables | |
| struct ipq_errmap_t | ipq_errmap [] |
| #define IPQ_MAXERR IPQ_ERR_PROTOCOL |
| anonymous enum |
| struct ipq_handle* ipq_create_handle | ( | uint32_t | flags, |
| uint32_t | protocol | ||
| ) |
| int ipq_ctl | ( | const struct ipq_handle * | h, |
| int | request, | ||
| ... | |||
| ) |
| int ipq_destroy_handle | ( | struct ipq_handle * | h | ) |
References ipq_handle::fd.
| char* ipq_errstr | ( | void | ) |
| int ipq_get_msgerr | ( | const unsigned char * | buf | ) |
References nlmsgerr::error, and NLMSG_DATA.
| ipq_packet_msg_t* ipq_get_packet | ( | const unsigned char * | buf | ) |
References NLMSG_DATA.
| int ipq_message_type | ( | const unsigned char * | buf | ) |
| void ipq_perror | ( | const char * | s | ) |
| ssize_t ipq_read | ( | const struct ipq_handle * | h, |
| unsigned char * | buf, | ||
| size_t | len, | ||
| int | timeout | ||
| ) |
| int ipq_set_mode | ( | const struct ipq_handle * | h, |
| uint8_t | mode, | ||
| size_t | range | ||
| ) |
References IPQM_MODE, ipq_handle::local, sockaddr_nl::nl_pid, NLM_F_REQUEST, NLMSG_LENGTH, and req.
| int ipq_set_verdict | ( | const struct ipq_handle * | h, |
| ipq_id_t | id, | ||
| unsigned int | verdict, | ||
| size_t | data_len, | ||
| unsigned char * | buf | ||
| ) |
| struct ipq_errmap_t ipq_errmap[] |