FreeBSD kernel IPv4 code
|
Go to the source code of this file.
Macros | |
#define | LIBALIAS_BUF_SIZE 128 |
#define | NO_FW_PUNCH |
#define | NO_USE_SOCKETS |
#define | PKT_ALIAS_LOG 0x01 |
#define | PKT_ALIAS_DENY_INCOMING 0x02 |
#define | PKT_ALIAS_SAME_PORTS 0x04 |
#define | PKT_ALIAS_UNREGISTERED_ONLY 0x10 |
#define | PKT_ALIAS_RESET_ON_ADDR_CHANGE 0x20 |
#define | PKT_ALIAS_PROXY_ONLY 0x40 |
#define | PKT_ALIAS_REVERSE 0x80 |
#define | PKT_ALIAS_SKIP_GLOBAL 0x200 |
#define | PKT_ALIAS_UNREGISTERED_CGN 0x400 |
#define | PKT_ALIAS_ERROR -1 |
#define | PKT_ALIAS_OK 1 |
#define | PKT_ALIAS_IGNORED 2 |
#define | PKT_ALIAS_UNRESOLVED_FRAGMENT 3 |
#define | PKT_ALIAS_FOUND_HEADER_FRAGMENT 4 |
Functions | |
struct libalias * | LibAliasInit (struct libalias *) |
void | LibAliasSetAddress (struct libalias *, struct in_addr _addr) |
void | LibAliasSetAliasPortRange (struct libalias *la, u_short port_low, u_short port_hi) |
void | LibAliasSetFWBase (struct libalias *, unsigned int _base, unsigned int _num) |
void | LibAliasSetSkinnyPort (struct libalias *, unsigned int _port) |
unsigned int | LibAliasSetMode (struct libalias *, unsigned int _flags, unsigned int _mask) |
void | LibAliasUninit (struct libalias *) |
int | LibAliasIn (struct libalias *, void *_ptr, int _maxpacketsize) |
int | LibAliasOut (struct libalias *, void *_ptr, int _maxpacketsize) |
int | LibAliasOutTry (struct libalias *, void *_ptr, int _maxpacketsize, int _create) |
int | LibAliasUnaliasOut (struct libalias *, void *_ptr, int _maxpacketsize) |
int | LibAliasAddServer (struct libalias *, struct alias_link *_lnk, struct in_addr _addr, unsigned short _port) |
struct alias_link * | LibAliasRedirectAddr (struct libalias *, struct in_addr _src_addr, struct in_addr _alias_addr) |
int | LibAliasRedirectDynamic (struct libalias *, struct alias_link *_lnk) |
void | LibAliasRedirectDelete (struct libalias *, struct alias_link *_lnk) |
struct alias_link * | LibAliasRedirectPort (struct libalias *, struct in_addr _src_addr, unsigned short _src_port, struct in_addr _dst_addr, unsigned short _dst_port, struct in_addr _alias_addr, unsigned short _alias_port, unsigned char _proto) |
struct alias_link * | LibAliasRedirectProto (struct libalias *, struct in_addr _src_addr, struct in_addr _dst_addr, struct in_addr _alias_addr, unsigned char _proto) |
void | LibAliasFragmentIn (struct libalias *, void *_ptr, void *_ptr_fragment) |
void * | LibAliasGetFragment (struct libalias *, void *_ptr) |
int | LibAliasSaveFragment (struct libalias *, void *_ptr) |
unsigned short | LibAliasInternetChecksum (struct libalias *, unsigned short *_ptr, int _nbytes) |
void | LibAliasSetTarget (struct libalias *, struct in_addr _target_addr) |
int | LibAliasProxyRule (struct libalias *, const char *_cmd) |
int | LibAliasLoadModule (char *) |
int | LibAliasUnLoadAllModule (void) |
int | LibAliasRefreshModules (void) |
struct mbuf * | m_megapullup (struct mbuf *, int) |
int LibAliasAddServer | ( | struct libalias * | , |
struct alias_link * | _lnk, | ||
struct in_addr | _addr, | ||
unsigned short | _port | ||
) |
void LibAliasFragmentIn | ( | struct libalias * | la, |
void * | _ptr, | ||
void * | _ptr_fragment | ||
) |
Definition at line 1293 of file alias.c.
References DifferentialChecksum(), ip::ip_dst, ip::ip_sum, LIBALIAS_LOCK, and LIBALIAS_UNLOCK.
void * LibAliasGetFragment | ( | struct libalias * | la, |
void * | _ptr | ||
) |
Definition at line 1272 of file alias.c.
References FindFragmentPtr(), GetFragmentPtr(), ip::ip_id, LIBALIAS_LOCK, LIBALIAS_UNLOCK, SetExpire(), and SetFragmentPtr().
int LibAliasIn | ( | struct libalias * | la, |
void * | _ptr, | ||
int | _maxpacketsize | ||
) |
Definition at line 1321 of file alias.c.
References LIBALIAS_LOCK, LIBALIAS_UNLOCK, and LibAliasInLocked().
Definition at line 2078 of file alias_db.c.
References libalias::aliasAddress, libalias::aliasPortLength, libalias::aliasPortLower, AliasSctpInit(), AliasSctpTerm(), CleanupAliasData(), finishoff(), libalias::fireWallFD, libalias::fragmentIdLinkCount, libalias::fragmentPtrLinkCount, libalias::icmpLinkCount, INADDR_ANY, LIBALIAS_LOCK, LIBALIAS_LOCK_INIT, LIBALIAS_UNLOCK, LibAliasRefreshModules(), LibAliasTime, libalias::packetAliasMode, PKT_ALIAS_RESET_ON_ADDR_CHANGE, PKT_ALIAS_SAME_PORTS, libalias::pptpLinkCount, libalias::protoLinkCount, in_addr::s_addr, libalias::sctpLinkCount, libalias::sockCount, libalias::targetAddress, libalias::tcpLinkCount, and libalias::udpLinkCount.
unsigned short LibAliasInternetChecksum | ( | struct libalias * | , |
unsigned short * | _ptr, | ||
int | _nbytes | ||
) |
int LibAliasLoadModule | ( | char * | ) |
int LibAliasOut | ( | struct libalias * | la, |
void * | _ptr, | ||
int | _maxpacketsize | ||
) |
Definition at line 1437 of file alias.c.
References alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, and LibAliasOutLocked().
int LibAliasOutTry | ( | struct libalias * | la, |
void * | _ptr, | ||
int | _maxpacketsize, | ||
int | _create | ||
) |
Definition at line 1448 of file alias.c.
References alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, and LibAliasOutLocked().
int LibAliasProxyRule | ( | struct libalias * | la, |
const char * | _cmd | ||
) |
Definition at line 539 of file alias_proxy.c.
References proxy_entry::dst_addr, proxy_entry::dst_mask, IpAddr(), IpMask(), IpPort(), IPPROTO_TCP, IPPROTO_UDP, proxy_entry::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, proxy_entry::proto, proxy_entry::proxy_port, proxy_entry::proxy_type, PROXY_TYPE_ENCODE_IPHDR, PROXY_TYPE_ENCODE_NONE, PROXY_TYPE_ENCODE_TCPSTREAM, proxy_entry::rule_index, RuleAdd(), RuleNumberDelete(), in_addr::s_addr, proxy_entry::server_addr, proxy_entry::server_port, proxy_entry::src_addr, proxy_entry::src_mask, state, STATE_READ_DELETE, STATE_READ_DST, STATE_READ_KEYWORD, STATE_READ_PORT, STATE_READ_PROTO, STATE_READ_RULE, STATE_READ_SERVER, STATE_READ_SRC, and STATE_READ_TYPE.
struct alias_link * LibAliasRedirectAddr | ( | struct libalias * | la, |
struct in_addr | _src_addr, | ||
struct in_addr | _alias_addr | ||
) |
Definition at line 1979 of file alias_db.c.
References AddLink(), alias_link::alias_addr, ANY_ADDR, alias_link::flags, alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, LINK_ADDR, LINK_PERMANENT, and alias_link::src_addr.
void LibAliasRedirectDelete | ( | struct libalias * | la, |
struct alias_link * | _lnk | ||
) |
Definition at line 2025 of file alias_db.c.
References DeleteLink(), alias_link::la, LIBALIAS_LOCK, and LIBALIAS_UNLOCK.
int LibAliasRedirectDynamic | ( | struct libalias * | la, |
struct alias_link * | _lnk | ||
) |
Definition at line 2005 of file alias_db.c.
References alias_link::flags, alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, and LINK_PARTIALLY_SPECIFIED.
struct alias_link * LibAliasRedirectPort | ( | struct libalias * | , |
struct in_addr | _src_addr, | ||
unsigned short | _src_port, | ||
struct in_addr | _dst_addr, | ||
unsigned short | _dst_port, | ||
struct in_addr | _alias_addr, | ||
unsigned short | _alias_port, | ||
unsigned char | _proto | ||
) |
struct alias_link * LibAliasRedirectProto | ( | struct libalias * | , |
struct in_addr | _src_addr, | ||
struct in_addr | _dst_addr, | ||
struct in_addr | _alias_addr, | ||
unsigned char | _proto | ||
) |
int LibAliasRefreshModules | ( | void | ) |
int LibAliasSaveFragment | ( | struct libalias * | la, |
void * | _ptr | ||
) |
Definition at line 1253 of file alias.c.
References AddFragmentPtrLink(), ip::ip_id, LIBALIAS_LOCK, LIBALIAS_UNLOCK, PKT_ALIAS_ERROR, PKT_ALIAS_OK, and SetFragmentPtr().
Definition at line 2034 of file alias_db.c.
References libalias::aliasAddress, CleanupAliasData(), alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, libalias::packetAliasMode, PKT_ALIAS_RESET_ON_ADDR_CHANGE, and in_addr::s_addr.
void LibAliasSetAliasPortRange | ( | struct libalias * | la, |
u_short | port_low, | ||
u_short | port_hi | ||
) |
Definition at line 2046 of file alias_db.c.
References libalias::aliasPortLength, libalias::aliasPortLower, alias_link::la, LIBALIAS_LOCK, and LIBALIAS_UNLOCK.
void LibAliasSetFWBase | ( | struct libalias * | la, |
unsigned int | _base, | ||
unsigned int | _num | ||
) |
Definition at line 2437 of file alias_db.c.
References libalias::fireWallBaseNum, libalias::fireWallNumNums, LIBALIAS_LOCK, and LIBALIAS_UNLOCK.
unsigned int LibAliasSetMode | ( | struct libalias * | la, |
unsigned int | _flags, | ||
unsigned int | _mask | ||
) |
Definition at line 2171 of file alias_db.c.
References InitPacketAliasLog(), InitPunchFW(), LIBALIAS_LOCK, LIBALIAS_UNLOCK, libalias::packetAliasMode, PKT_ALIAS_LOG, UninitPacketAliasLog(), and UninitPunchFW().
void LibAliasSetSkinnyPort | ( | struct libalias * | la, |
unsigned int | _port | ||
) |
Definition at line 2448 of file alias_db.c.
References LIBALIAS_LOCK, LIBALIAS_UNLOCK, and libalias::skinnyPort.
Definition at line 2063 of file alias_db.c.
References alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, and libalias::targetAddress.
int LibAliasUnaliasOut | ( | struct libalias * | la, |
void * | _ptr, | ||
int | _maxpacketsize | ||
) |
Definition at line 1562 of file alias.c.
References ADJUST_CHECKSUM, DifferentialChecksum(), FindIcmpIn(), FindUdpTcpIn(), GetOriginalAddress(), GetOriginalPort(), icmp::icmp_cksum, ip::ip_dst, ip::ip_hl, ip::ip_len, ip::ip_p, ip::ip_sum, IPPROTO_ICMP, IPPROTO_TCP, IPPROTO_UDP, alias_link::la, LIBALIAS_LOCK, LIBALIAS_UNLOCK, PKT_ALIAS_IGNORED, PKT_ALIAS_OK, twowords(), udphdr::uh_dport, udphdr::uh_sport, and udphdr::uh_sum.
void LibAliasUninit | ( | struct libalias * | la | ) |
Definition at line 2152 of file alias_db.c.
References AliasSctpTerm(), CleanupAliasData(), LIBALIAS_LOCK, LIBALIAS_LOCK_DESTROY, LIBALIAS_UNLOCK, UninitPacketAliasLog(), and UninitPunchFW().
Referenced by finishoff().
int LibAliasUnLoadAllModule | ( | void | ) |