45#include <sys/limits.h>
46#include <sys/kernel.h>
47#include <sys/module.h>
67#define PPTP_CONTROL_PORT_NUMBER 1723
84 if (ah->
dport == NULL || ah->
sport == NULL || ah->
lnk == NULL)
240#define PPTP_GRE_PROTO 0x880b
243#define PPTP_INIT_VALUE ((0x2001 << 16) | PPTP_GRE_PROTO)
244#define PPTP_INIT_MASK 0xef7fffff
246#define PPTP_MAGIC 0x1a2b3c4d
247#define PPTP_CTRL_MSG_TYPE 1
332 if (pptp_lnk != NULL) {
333 int accumulate = cptr->
cid1;
339 tc = (
struct tcphdr *)ip_next(pip);
340 accumulate -= cptr->
cid1;
383 pcall_id = &cptr->
cid1;
387 pcall_id = &cptr->
cid2;
393 if (pptp_lnk != NULL)
404 if (pptp_lnk != NULL) {
405 int accumulate = *pcall_id;
411 tc = (
struct tcphdr *)ip_next(pip);
412 accumulate -= *pcall_id;
433 int hlen, tlen, dlen;
438 tc = (
struct tcphdr *)ip_next(pip);
439 hlen = (pip->
ip_hl + tc->th_off) << 2;
440 tlen = ntohs(pip->
ip_len);
451 *ptype = ntohs(hptr->
type);
473 gr = (
GreHdr *)ip_next(pip);
485 &alias_addr, &pip->ip_src, 2);
486 pip->ip_src = alias_addr;
497 gr = (
GreHdr *)ip_next(pip);
512 &src_addr, &pip->
ip_dst, 2);
#define PKT_ALIAS_PROXY_ONLY
u_short GetAliasPort(struct alias_link *lnk)
struct in_addr GetAliasAddress(struct alias_link *lnk)
struct alias_link * FindPptpOutByPeerCallId(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, u_int16_t dst_call_id)
struct in_addr GetDestAddress(struct alias_link *lnk)
void SetExpire(struct alias_link *lnk, int expire)
struct alias_link * FindPptpInByPeerCallId(struct libalias *la, struct in_addr dst_addr, struct in_addr alias_addr, u_int16_t alias_call_id)
struct alias_link * FindPptpOutByCallId(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, u_int16_t src_call_id)
struct alias_link * AddPptp(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, struct in_addr alias_addr, u_int16_t src_call_id)
struct alias_link * FindPptpInByCallId(struct libalias *la, struct in_addr dst_addr, struct in_addr alias_addr, u_int16_t dst_call_id)
struct in_addr GetOriginalAddress(struct alias_link *lnk)
void SetDestCallId(struct alias_link *lnk, u_int16_t cid)
u_short GetOriginalPort(struct alias_link *lnk)
#define ADJUST_CHECKSUM(acc, cksum)
void DifferentialChecksum(u_short *_cksum, void *_new, void *_old, int _n)
int LibAliasAttachHandlers(struct proto_handler *p)
int LibAliasDetachHandlers(struct proto_handler *p)
static int mod_handler(module_t mod, int type, void *data)
@ PPTP_StartCtrlConnReply
@ PPTP_StopCtrlConnRequest
@ PPTP_StartCtrlConnRequest
static int protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah)
#define PPTP_CONTROL_PORT_NUMBER
DECLARE_MODULE(alias_pptp, alias_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND)
static void AliasHandlePptpOut(struct libalias *, struct ip *, struct alias_link *)
static PptpCallId AliasVerifyPptp(struct ip *, u_int16_t *)
static int AliasHandlePptpGreIn(struct libalias *, struct ip *)
static int fingerprint(struct libalias *la, struct alias_data *ah)
static moduledata_t alias_mod
static int fingerprintgre(struct libalias *la, struct alias_data *ah)
struct pptpMsgHead * PptpMsgHead
static int AliasHandlePptpGreOut(struct libalias *, struct ip *)
struct pptpCodes * PptpCode
struct pptpCallIds * PptpCallId
static int protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah)
static int protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah)
struct proto_handler handlers[]
static int protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah)
MODULE_VERSION(alias_pptp, 1)
static void AliasHandlePptpIn(struct libalias *, struct ip *, struct alias_link *)
MODULE_DEPEND(alias_pptp, libalias, 1, 1, 1)
#define PPTP_CTRL_MSG_TYPE
struct in_addr ip_src ip_dst