📄 wipfw.h.svn-base
字号:
/*
* Copyright (c) 2004 Vlad Goncharov, Ruslan Staritsin
*
* Redistribution and use in source forms, with and without modification,
* are permitted provided that this entire comment appears intact.
*
* Redistribution in binary form may occur without any restrictions.
* Obviously, it would be nice if you gave credit where credit is due
* but requiring it would be too onerous.
*
* This software is provided ``AS IS'' without any warranties of any kind.
*/
#ifndef _wipfw_h_
#define _wipfw_h_
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#define IP_FW_ADD 50 /* add a firewall rule to chain */
#define IP_FW_DEL 51 /* delete a firewall rule from chain */
#define IP_FW_FLUSH 52 /* flush firewall rule chain */
#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
#define IP_FW_GET 54 /* get entire firewall rule chain */
#define IP_FW_RESETLOG 55 /* reset logging counters */
#define FILE_DEVICE_IPFW 0x00654324
#define IP_FW_BASE_CTL 0x840
#define IP_FW_SETSOCKOPT \
CTL_CODE(FILE_DEVICE_IPFW, IP_FW_BASE_CTL + 1, METHOD_BUFFERED, FILE_WRITE_DATA)
#define IP_FW_GETSOCKOPT \
CTL_CODE(FILE_DEVICE_IPFW, IP_FW_BASE_CTL + 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IP_FW_SET_IFLIST \
CTL_CODE(FILE_DEVICE_IPFW, IP_FW_BASE_CTL + 3, METHOD_BUFFERED, FILE_WRITE_DATA)
#define IP_FW_SYSCTL_IO \
CTL_CODE(FILE_DEVICE_IPFW, IP_FW_BASE_CTL + 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IP_FW_GET_IFLIST \
CTL_CODE(FILE_DEVICE_IPFW, IP_FW_BASE_CTL + 5, METHOD_BUFFERED, FILE_READ_DATA)
#pragma pack(1)
enum sopt_dir { SOPT_GET, SOPT_SET };
struct sockopt {
// Vlad: changed & ripped
enum sopt_dir sopt_dir; /* is this a get or a set? */
int sopt_name; /* third arg of [gs]etsockopt */
size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */
char *sopt_val; /* fourth arg of [gs]etsockopt (ignored in user-level) */
char sopt_val_buf[0]; /* for easy data transfer */
};
struct ip_fw_iflist_entry {
u_int32_t size; // size of the whole entry
char name[16]; // "eth", "ppp", "lo", etc. (size is equal to if_net in struct ifnet)
u_int16_t unit; // eth0, etc.
u_int32_t indx; // iphlpapi interface index
u_int16_t addr_count;
struct sockaddr_in addr[0]; // IPv4 addresses only for now
};
enum sysctlvar {
FW_ONE_PASS,
FW_DEBUG,
FW_VERBOSE,
FW_VERBOSE_LIMIT,
DYN_BUCKETS,
CURR_DYN_BUCKETS,
DYN_COUNT,
DYN_MAX,
STATIC_COUNT,
DYN_ACK_LIFETIME,
DYN_SYN_LIFETIME,
DYN_FIN_LIFETIME,
DYN_RST_LIFETIME,
DYN_UDP_LIFETIME,
DYN_SHORT_LIFETIME,
DYN_GRACE_TIME
};
struct sysctl {
enum sopt_dir sopt_dir; /* is this a get or a set? */
int sysctl_name;
int sysctl_val;
};
#pragma pack()
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -