summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/alias.p
blob: 5d33f1298d2ab65c2e9a1f1c935724d0795873cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
    Alias.p contains the function prototypes for alias.c, alias_db.c,
    alias_util.c and alias_ftp.c (as well as any future add-ons).  It
    is intended to be used only within the aliasing software.  Outside
    world interfaces are defined in alias.h


    This software is placed into the public domain with no restrictions
    on its distribution.

    Initial version:  August, 1996  (cjm)    
*/

#define NULL_PTR 0

/* General utilities */
u_short InternetChecksum(u_short *, int);
u_short IpChecksum(struct ip *);
u_short TcpChecksum(struct ip *);

/* Data access utilities */
int StartPoint(struct in_addr, u_short, int);
u_short GetNewPort();
int SeqDiff(u_long, u_long);
void ShowAliasStats();

/* Internal data access */
void CleanupAliasData();
void IncrementalCleanup();
char * FindLink1(struct in_addr, struct in_addr, u_short, u_short, int);
char * FindLink2(struct in_addr, u_short, u_short, int);
void DeleteLink(char *);
char * AddLink(struct in_addr, struct in_addr, u_short, u_short,
               u_short, int);

/* External data search */
char * FindIcmpIn(struct in_addr, u_short, u_short);
char * FindIcmpOut(struct in_addr, struct in_addr, u_short, u_short);
char * FindFragmentIn1(struct in_addr);
char * FindFragmentIn2(struct in_addr);
char * FindUdpIn(struct in_addr, u_short, u_short);
char * FindUdpOut(struct in_addr, struct in_addr, u_short, u_short);
char * FindTcpIn(struct in_addr, u_short, u_short);
char * FindTcpOut(struct in_addr, struct in_addr, u_short, u_short);

/* External data access/modification */
void GetIcmpData(char *, u_short, u_short, u_long *);
void SetIcmpData(char *, u_short, u_short, u_long);
void GetFragmentAddr(char *, u_short, u_char, struct in_addr *);
void SetFragmentData(char *, u_short, u_char, struct in_addr);
void SetStateIn(char *, int);
void SetStateOut(char *, int);
int GetStateIn(char *);
int GetStateOut(char *);
struct in_addr GetOriginalAddress(char *);
struct in_addr GetDestAddress(char *);
struct in_addr GetAliasAddress();
u_short GetOriginalPort(char *);
u_short GetDestPort(char *);
u_short GetAliasPort(char *);
void SetAckModified(char *);
int GetAckModified(char *);
int GetDeltaAckIn(struct ip *, char *);
int GetDeltaSeqOut(struct ip *, char *);
void AddSeq(struct ip *, char *, int);

/* Tcp specfic routines */
void TcpMonitorIn(struct ip *, char *);
void TcpMonitorOut(struct ip *, char *);
void HandleFtpOut(struct ip *, char *);
void NewFtpPortCommand(struct ip *, char *, struct in_addr, u_short);

/* Protocal specific packet aliasing routines */
void IcmpAliasIn1(struct ip *);
void IcmpAliasIn2(struct ip *);
void IcmpAliasIn(struct ip *);
void IcmpAliasOut(struct ip *);
void IcmpAliasOut1(struct ip *);
void UdpAliasIn(struct ip *);
void UdpAliasOut(struct ip *);
void TcpAliasIn(struct ip *);
void TcpAliasOut(struct ip *);

/* Fragment handling */
void FragmentIn(struct ip *);
void FragmentOut(struct ip *);

/* Outside world interfaces */
void PacketAliasIn(struct ip *);
void PacketAliasOut(struct ip *);
void SetAliasAddress(struct in_addr);
void InitAlias();
void InitAliasLog();

OpenPOWER on IntegriCloud