#include "config.h"#include <iphlpapi.h>#include <ctype.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "dnet.h"Go to the source code of this file.
Classes | |
| struct | fw_handle |
Defines | |
| #define | PKTFILTER_PIPE "\\\\.\\pipe\\PktFltPipe" |
| #define | MAX_RULE_LENGTH 256 |
| #define | FILTER_FAILURE 0 |
| #define | FILTER_SUCCESS 1 |
| #define | FILTER_MESSAGE 2 |
Functions | |
| static int | parse_addr (char *p, struct addr *a) |
| static int | parse_portspec (char *str, uint16_t *ports) |
| static int | parse_icmpspec (char *str, uint16_t *type, uint16_t *code) |
| static int | parse_rule (char *str, struct fw_rule *rule) |
| static int | format_rule (const struct fw_rule *rule, char *buf, int len) |
| static char * | call_pipe (const char *msg, int len) |
| fw_t * | fw_open (void) |
| int | fw_add (fw_t *f, const struct fw_rule *rule) |
| int | fw_delete (fw_t *f, const struct fw_rule *rule) |
| int | fw_loop (fw_t *f, fw_handler callback, void *arg) |
| fw_t * | fw_close (fw_t *f) |
Variables | |
| char * | icmp_types [] |
|
|
Definition at line 25 of file fw-pktfilter.c. Referenced by call_pipe(). |
|
|
Definition at line 27 of file fw-pktfilter.c. Referenced by call_pipe(). |
|
|
Definition at line 26 of file fw-pktfilter.c. Referenced by call_pipe(). |
|
|
Definition at line 23 of file fw-pktfilter.c. Referenced by fw_add(), fw_delete(), and fw_loop(). |
|
|
Definition at line 22 of file fw-pktfilter.c. Referenced by call_pipe(). |
|
||||||||||||
|
Definition at line 278 of file fw-pktfilter.c. References DWORD, FILTER_FAILURE, FILTER_MESSAGE, FILTER_SUCCESS, HANDLE, NULL, and PKTFILTER_PIPE. Referenced by fw_add(), fw_delete(), and fw_loop(). |
|
||||||||||||||||
|
Definition at line 215 of file fw-pktfilter.c. References addr_ntoa(), addr::addr_type, ADDR_TYPE_NONE, fw_rule::fw_device, fw_rule::fw_dir, FW_DIR_IN, fw_rule::fw_dport, fw_rule::fw_dst, fw_rule::fw_op, FW_OP_ALLOW, fw_rule::fw_proto, fw_rule::fw_sport, fw_rule::fw_src, IP_PROTO_ICMP, IP_PROTO_TCP, IP_PROTO_UDP, snprintf, strlcat(), and strlcpy. Referenced by fw_add(), and fw_delete(). |
|
||||||||||||
|
Definition at line 355 of file fw-pktfilter.c. References call_pipe(), format_rule(), MAX_RULE_LENGTH, and NULL. Referenced by __pyx_f_4dnet_2fw_add(), and fw_main(). |
|
|
Definition at line 437 of file fw-pktfilter.c. References NULL. Referenced by __pyx_f_4dnet_2fw___dealloc__(), fw_main(), fw_open(), and START_TEST(). |
|
||||||||||||
|
Definition at line 369 of file fw-pktfilter.c. References call_pipe(), errno, format_rule(), fw_rule::fw_device, MAX_RULE_LENGTH, memcmp(), NULL, parse_rule(), snprintf, and strsep(). Referenced by __pyx_f_4dnet_2fw_delete(), and fw_main(). |
|
||||||||||||||||
|
Definition at line 408 of file fw-pktfilter.c. References call_pipe(), fw_handle::ifinfo, MAX_RULE_LENGTH, NULL, parse_rule(), snprintf, and strsep(). Referenced by __pyx_f_4dnet_2fw_loop(), and fw_main(). |
|
|
Definition at line 316 of file fw-pktfilter.c. References _IP_ADAPTER_INFO::AdapterName, _IP_ADAPTER_INFO::ComboIndex, GetAdaptersInfo(), _IP_ADAPTER_INFO::Next, NULL, and _IP_ADAPTER_INFO::Type. Referenced by __pyx_f_4dnet_2fw___init__(), fw_main(), and START_TEST(). |
|
||||||||||||
|
Definition at line 58 of file fw-pktfilter.c. References addr_aton. Referenced by parse_rule(). |
|
||||||||||||||||
|
Definition at line 89 of file fw-pktfilter.c. References icmp_types, NULL, strsep(), and strtol(). Referenced by parse_rule(). |
|
||||||||||||
|
Definition at line 66 of file fw-pktfilter.c. References strsep(), and TCP_PORT_MAX. Referenced by parse_rule(). |
|
||||||||||||
|
Definition at line 125 of file fw-pktfilter.c. References FW_DIR_IN, FW_DIR_OUT, FW_OP_ALLOW, FW_OP_BLOCK, IP_PROTO_ICMP, IP_PROTO_TCP, IP_PROTO_UDP, memset, NULL, parse_addr(), parse_icmpspec(), parse_portspec(), strlcpy, strsep(), and strstr(). Referenced by fw_delete(), and fw_loop(). |
|
|
Initial value: {
"echorep",
"",
"",
"unreach",
"squench",
"redir",
"",
"",
"echo",
"router_adv",
"router_sol",
"timex",
"paramprob",
"timest",
"timestrep",
"inforeq",
"inforep",
"maskreq",
"maskrep",
NULL
}
Definition at line 29 of file fw-pktfilter.c. Referenced by parse_icmpspec(). |
1.4.2