diff options
author | Mystery Man <unknown@mandriva.org> | 2005-08-22 14:57:05 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2005-08-22 14:57:05 +0000 |
commit | c4c6eb3de2799d5544e9cc8703b0261c0a3350d6 (patch) | |
tree | b9f1a4c99ae89c4210c2c2848b16e66430b63700 /mdk-stage1/rp-pppoe/src/relay.h | |
parent | a723a6e26fc5be438675cc29b636f0b61547ec32 (diff) | |
download | drakx-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar drakx-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar.gz drakx-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar.bz2 drakx-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.tar.xz drakx-c4c6eb3de2799d5544e9cc8703b0261c0a3350d6.zip |
This commit was manufactured by cvs2svn to create tagV10_3_0_48mdk
'V10_3_0_48mdk'.
Diffstat (limited to 'mdk-stage1/rp-pppoe/src/relay.h')
-rw-r--r-- | mdk-stage1/rp-pppoe/src/relay.h | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/mdk-stage1/rp-pppoe/src/relay.h b/mdk-stage1/rp-pppoe/src/relay.h deleted file mode 100644 index d438a657f..000000000 --- a/mdk-stage1/rp-pppoe/src/relay.h +++ /dev/null @@ -1,97 +0,0 @@ -/********************************************************************** -* -* relay.h -* -* Definitions for PPPoE relay -* -* Copyright (C) 2001 Roaring Penguin Software Inc. -* -* This program may be distributed according to the terms of the GNU -* General Public License, version 2 or (at your option) any later version. -* -* $Id$ -* -***********************************************************************/ - -#include "pppoe.h" - -/* Description for each active Ethernet interface */ -typedef struct InterfaceStruct { - char name[IFNAMSIZ+1]; /* Interface name */ - int discoverySock; /* Socket for discovery frames */ - int sessionSock; /* Socket for session frames */ - int clientOK; /* Client requests allowed (PADI, PADR) */ - int acOK; /* AC replies allowed (PADO, PADS) */ - unsigned char mac[ETH_ALEN]; /* MAC address */ -} PPPoEInterface; - -/* Session state for relay */ -struct SessionHashStruct; -typedef struct SessionStruct { - struct SessionStruct *next; /* Free list link */ - struct SessionStruct *prev; /* Free list link */ - struct SessionHashStruct *acHash; /* Hash bucket for AC MAC/Session */ - struct SessionHashStruct *clientHash; /* Hash bucket for client MAC/Session */ - unsigned int epoch; /* Epoch when last activity was seen */ - UINT16_t sesNum; /* Session number assigned by relay */ -} PPPoESession; - -/* Hash table entry to find sessions */ -typedef struct SessionHashStruct { - struct SessionHashStruct *next; /* Link in hash chain */ - struct SessionHashStruct *prev; /* Link in hash chain */ - struct SessionHashStruct *peer; /* Peer for this session */ - PPPoEInterface const *interface; /* Interface */ - unsigned char peerMac[ETH_ALEN]; /* Peer's MAC address */ - UINT16_t sesNum; /* Session number */ - PPPoESession *ses; /* Session data */ -} SessionHash; - -/* Function prototypes */ - -void relayGotSessionPacket(PPPoEInterface const *i); -void relayGotDiscoveryPacket(PPPoEInterface const *i); -PPPoEInterface *findInterface(int sock); -unsigned int hash(unsigned char const *mac, UINT16_t sesNum); -SessionHash *findSession(unsigned char const *mac, UINT16_t sesNum); -void deleteHash(SessionHash *hash); -PPPoESession *createSession(PPPoEInterface const *ac, - PPPoEInterface const *cli, - unsigned char const *acMac, - unsigned char const *cliMac, - UINT16_t acSes); -void freeSession(PPPoESession *ses, char const *msg); -void addInterface(char const *ifname, int clientOK, int acOK); -void usage(char const *progname); -void initRelay(int nsess); -void relayLoop(void); -void addHash(SessionHash *sh); -void unhash(SessionHash *sh); - -void relayHandlePADT(PPPoEInterface const *iface, PPPoEPacket *packet, int size); -void relayHandlePADI(PPPoEInterface const *iface, PPPoEPacket *packet, int size); -void relayHandlePADO(PPPoEInterface const *iface, PPPoEPacket *packet, int size); -void relayHandlePADR(PPPoEInterface const *iface, PPPoEPacket *packet, int size); -void relayHandlePADS(PPPoEInterface const *iface, PPPoEPacket *packet, int size); - -int addTag(PPPoEPacket *packet, PPPoETag const *tag); -int insertBytes(PPPoEPacket *packet, unsigned char *loc, - void const *bytes, int length); -int removeBytes(PPPoEPacket *packet, unsigned char *loc, - int length); -void relaySendError(unsigned char code, - UINT16_t session, - PPPoEInterface const *iface, - unsigned char const *mac, - PPPoETag const *hostUniq, - char const *errMsg); - -void alarmHandler(int sig); -void cleanSessions(void); - -#define MAX_INTERFACES 8 -#define DEFAULT_SESSIONS 5000 - -/* Hash table size -- a prime number; gives load factor of around 6 - for 65534 sessions */ -#define HASHTAB_SIZE 18917 |