X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fpppoe.h;h=4e1972002ed80e17d5790c0f07c1d82bb2fb1d85;hb=HEAD;hp=b3d21847b7ec27d129ff3b6c69908e5e79ced927;hpb=cd5b0f0543cad042df126cf8ad1a238e5d13dd17;p=ppp.git diff --git a/pppd/plugins/pppoe/pppoe.h b/pppd/plugins/pppoe/pppoe.h index b3d2184..1952dcb 100644 --- a/pppd/plugins/pppoe/pppoe.h +++ b/pppd/plugins/pppoe/pppoe.h @@ -9,18 +9,14 @@ * 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: pppoe.h,v 1.4 2008/06/15 04:35:50 paulus Exp $ -* ***********************************************************************/ -#include "config.h" - #include /* For FILE */ #include /* For pid_t */ #include #include -#include "pppd/pppd.h" /* For error */ +#include /* For error */ /* How do we access raw Ethernet devices? */ #undef USE_LINUX_PACKET @@ -233,7 +229,6 @@ typedef struct PPPoEConnectionStruct { char *acName; /* Desired AC name, if any */ int synchronous; /* Use synchronous PPP */ PPPoETag hostUniq; /* Use Host-Uniq tag */ - FILE *debugFile; /* Debug file for dumping packets */ int numPADOs; /* Number of PADO packets received */ PPPoETag cookie; /* We have to send this if we get it */ PPPoETag relayId; /* Ditto */ @@ -245,6 +240,7 @@ typedef struct PPPoEConnectionStruct { int storedmru; /* Stored MRU */ int mtu; int mru; + char *actualACname; /* Name of AC we connected to */ } PPPoEConnection; /* Structure used to determine acceptable PADO or PADS packet */ @@ -261,9 +257,6 @@ UINT16_t etherType(PPPoEPacket *packet); int openInterface(char const *ifname, UINT16_t type, unsigned char *hwaddr); int sendPacket(PPPoEConnection *conn, int sock, PPPoEPacket *pkt, int size); int receivePacket(int sock, PPPoEPacket *pkt, int *size); -void fatalSys(char const *str); -void dumpPacket(FILE *fp, PPPoEPacket *packet, char const *dir); -void dumpHex(FILE *fp, unsigned char const *buf, int len); int parsePacket(PPPoEPacket *packet, ParseFunc *func, void *extra); void parseLogErrs(UINT16_t typ, UINT16_t len, unsigned char *data, void *xtra); void syncReadFromPPP(PPPoEConnection *conn, PPPoEPacket *packet); @@ -278,7 +271,7 @@ void initPPP(void); void clampMSS(PPPoEPacket *packet, char const *dir, int clampMss); UINT16_t computeTCPChecksum(unsigned char *ipHdr, unsigned char *tcpHdr); UINT16_t pppFCS16(UINT16_t fcs, unsigned char *cp, int len); -void discovery1(PPPoEConnection *conn); +void discovery1(PPPoEConnection *conn, int waitWholeTimeoutForPADO); void discovery2(PPPoEConnection *conn); unsigned char *findTag(PPPoEPacket *packet, UINT16_t tagType, PPPoETag *tag); @@ -328,3 +321,10 @@ do {\ #define NOT_UNICAST(e) ((e[0] & 0x01) != 0) #define BROADCAST(e) ((e[0] & e[1] & e[2] & e[3] & e[4] & e[5]) == 0xFF) #define NOT_BROADCAST(e) ((e[0] & e[1] & e[2] & e[3] & e[4] & e[5]) != 0xFF) + +#ifndef MIN +#define MIN(a, b) ((a) < (b)? (a): (b)) +#endif +#ifndef MAX +#define MAX(a, b) ((a) > (b)? (a): (b)) +#endif