#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/ctype.h>
#include <sys/libkern.h>
#include <sys/limits.h>
#include <netinet/tcp.h>
#include <netinet/libalias/alias.h>
#include <netinet/libalias/alias_local.h>
#include <netinet/libalias/alias_mod.h>
Go to the source code of this file.
|
| __FBSDID ("$FreeBSD$") |
|
static int | IpMask (int, struct in_addr *) |
|
static int | IpAddr (char *, struct in_addr *) |
|
static int | IpPort (char *, int, int *) |
|
static void | RuleAdd (struct libalias *la, struct proxy_entry *) |
|
static void | RuleDelete (struct proxy_entry *) |
|
static int | RuleNumberDelete (struct libalias *la, int) |
|
static void | ProxyEncodeTcpStream (struct alias_link *, struct ip *, int) |
|
static void | ProxyEncodeIpHeader (struct ip *, int) |
|
int | ProxyCheck (struct libalias *la, struct in_addr *proxy_server_addr, u_short *proxy_server_port, struct in_addr src_addr, struct in_addr dst_addr, u_short dst_port, u_char ip_p) |
|
void | ProxyModify (struct libalias *la, struct alias_link *lnk, struct ip *pip, int maxpacketsize, int proxy_type) |
|
int | LibAliasProxyRule (struct libalias *la, const char *cmd) |
|
◆ OPTION_LEN_BYTES
#define OPTION_LEN_BYTES 8 |
◆ OPTION_LEN_INT16
#define OPTION_LEN_INT16 4 |
◆ OPTION_LEN_INT32
#define OPTION_LEN_INT32 2 |
◆ PROXY_TYPE_ENCODE_IPHDR
#define PROXY_TYPE_ENCODE_IPHDR 3 |
◆ PROXY_TYPE_ENCODE_NONE
#define PROXY_TYPE_ENCODE_NONE 1 |
◆ PROXY_TYPE_ENCODE_TCPSTREAM
#define PROXY_TYPE_ENCODE_TCPSTREAM 2 |
◆ STATE_READ_DELETE
#define STATE_READ_DELETE 5 |
◆ STATE_READ_DST
◆ STATE_READ_KEYWORD
#define STATE_READ_KEYWORD 0 |
◆ STATE_READ_PORT
#define STATE_READ_PORT 2 |
◆ STATE_READ_PROTO
#define STATE_READ_PROTO 6 |
◆ STATE_READ_RULE
#define STATE_READ_RULE 4 |
◆ STATE_READ_SERVER
#define STATE_READ_SERVER 3 |
◆ STATE_READ_SRC
◆ STATE_READ_TYPE
#define STATE_READ_TYPE 1 |
◆ __FBSDID()
◆ IpAddr()
static int IpAddr |
( |
char * |
s, |
|
|
struct in_addr * |
addr |
|
) |
| |
|
static |
◆ IpMask()
static int IpMask |
( |
int |
nbits, |
|
|
struct in_addr * |
mask |
|
) |
| |
|
static |
◆ IpPort()
static int IpPort |
( |
char * |
s, |
|
|
int |
proto, |
|
|
int * |
port |
|
) |
| |
|
static |
◆ LibAliasProxyRule()
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.
◆ ProxyCheck()
int ProxyCheck |
( |
struct libalias * |
la, |
|
|
struct in_addr * |
proxy_server_addr, |
|
|
u_short * |
proxy_server_port, |
|
|
struct in_addr |
src_addr, |
|
|
struct in_addr |
dst_addr, |
|
|
u_short |
dst_port, |
|
|
u_char |
ip_p |
|
) |
| |
Definition at line 457 of file alias_proxy.c.
References proxy_entry::dst_addr, proxy_entry::dst_mask, ip_p, proxy_entry::la, LIBALIAS_LOCK_ASSERT, proxy_entry::next, proxy_entry::proto, proxy_entry::proxy_port, proxy_entry::proxy_type, libalias::proxyList, in_addr::s_addr, proxy_entry::server_addr, proxy_entry::server_port, proxy_entry::src_addr, and proxy_entry::src_mask.
Referenced by TcpAliasOut(), and UdpAliasOut().
◆ ProxyEncodeIpHeader()
static void ProxyEncodeIpHeader |
( |
struct ip * |
pip, |
|
|
int |
maxpacketsize |
|
) |
| |
|
static |
◆ ProxyEncodeTcpStream()
static void ProxyEncodeTcpStream |
( |
struct alias_link * |
lnk, |
|
|
struct ip * |
pip, |
|
|
int |
maxpacketsize |
|
) |
| |
|
static |
Definition at line 287 of file alias_proxy.c.
References AddSeq(), ADJUST_CHECKSUM, GetAckModified(), GetDeltaSeqOut(), GetProxyAddress(), GetProxyPort(), INET_NTOA_BUF, inet_ntoa_r(), ip::ip_hl, ip::ip_len, ip::ip_sum, and SetAckModified().
Referenced by ProxyModify().
◆ ProxyModify()
void ProxyModify |
( |
struct libalias * |
la, |
|
|
struct alias_link * |
lnk, |
|
|
struct ip * |
pip, |
|
|
int |
maxpacketsize, |
|
|
int |
proxy_type |
|
) |
| |
◆ RuleAdd()
◆ RuleDelete()
◆ RuleNumberDelete()
static int RuleNumberDelete |
( |
struct libalias * |
la, |
|
|
int |
rule_index |
|
) |
| |
|
static |