📄 adapter.h
字号:
/* MikroTik PPPoE - MikroTik PPP over Ethernet client for Windows Copyright (C), 2001 MikroTikls The contents of this program are subject to the Mozilla Public License Version 1.1; you may not use this program except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ http://www.mikrotik.com mt@mt.lv*/#ifndef _PPPOE_ADAPTER_H_#define _PPPOE_ADAPTER_H_#include "my.h"#include "packet.h"typedef struct _DATABUF_DESCR { PVOID data; ULONG len; PULONG bytesUsed; PULONG bytesNeeded;} DATABUF_DESCR, *PDATABUF_DESCR;struct _ADAPTER;typedef void (*ADAPT_REQ_HANDLER)(struct _ADAPTER *, NDIS_STATUS, PVOID, UINT, UINT, PDATABUF_DESCR);typedef ADAPT_REQ_HANDLER ADAPTER_REQ_HANDLER;typedef struct _ADAPT_REQ { struct _ADAPT_REQ *next; NDIS_REQUEST req; ADAPT_REQ_HANDLER handler; DATABUF_DESCR params;} ADAPT_REQ, *PADAPT_REQ;typedef struct _TRANSMIT_PROTOINFO { PNDIS_WAN_PACKET wanPacket; PPPOE_PACKET *pppoePacket; UINT pppoePacketLen;} TRANSMIT_PROTOINFO, *PTRANSMIT_PROTOINFO;typedef struct _RECEIVE_PROTOINFO { PPPOE_PACKET *pppoePacket; UINT pppoePacketLen;} RECEIVE_PROTOINFO, *PRECEIVE_PROTOINFO;typedef struct _RECEIVED_PACKET_LIST { struct _RECEIVED_PACKET_LIST *next; PPPOE_PACKET *packet; ULONG total_size;} RECEIVED_PACKET_LIST, *PRECEIVED_PACKET_LIST;typedef enum { PPPOE_STATE_IDLE, PPPOE_STATE_PADI, PPPOE_STATE_PADR, PPPOE_STATE_SESSION, PPPOE_STATE_PADT // PADT received} PPPOE_STATE;typedef struct _ADAPTER{ struct _ADAPTER *next; // protocol stuff (in general this means - stuff about underlaying ethernet adapter) NDIS_HANDLE protoBindContext; NDIS_HANDLE protoBindingHandle; NDIS_STRING protoAdapterName; ULONG protoLinkSpeed; UCHAR protoMacAddr[6]; NDIS_RW_LOCK protoSyncReqLock; // used to serialize sync requests volatile UINT protoSyncReqComplete; // sync request status flag volatile UINT protoSyncReqAlen; volatile NDIS_STATUS protoSyncReqStatus; // status of sync req PVOID protoSyncReqData; // where sync request data resides (for query) UINT protoSyncReqLen; // sync request data len NDIS_RW_LOCK protoReqLock; // protect protoReqs PADAPT_REQ protoReqs; // pending requests NPAGED_LOOKASIDE_LIST protoReceivedPacketsLookasideList; NDIS_RW_LOCK protoReceivedPacketsLock; PRECEIVED_PACKET_LIST protoReceivedPackets; PRECEIVED_PACKET_LIST protoReceivedPacketLast; // miniport stuff NDIS_HANDLE miniAdapterHandle; ULONG miniSupportedCallStates; // call states that we can report ULONG miniSupportedLinedevStates; // linedev states that we can report ULONG miniReportedCallStates; // call states that we report currently ULONG miniReportedLinedevStates; // linedev states that we report currently ULONG miniCallState; // current call state ULONG miniLinedevState; // current linedev state NDIS_HANDLE miniNdisLinkContext; // returned by WAN_LINE_UP ULONG miniUlDeviceIDBase; ULONG miniUlDeviceID; ULONG miniHtLine; ULONG miniHtCall; // pppoe stuff PPPOE_STATE pppoeState; unsigned pppoePacketsReceived; // To know should we generate lcd echo messages or not. unsigned pppoeLcpRetries; NDIS_HANDLE pppoePacketPoolHandle; // packet pool handle NDIS_HANDLE pppoeBufferPoolHandle; // buffer pool handle UCHAR pppoeServerMacAddr[6]; USHORT pppoeSessionId; PCHAR pppoeServiceName; UINT pppoeServiceNameLen; PCHAR pppoeRealServiceName; UINT pppoeRealServiceNameLen; PCHAR pppoeACName; UINT pppoeACNameLen; ULONG pppoeHostUniq; NDIS_TIMER pppoeTimer; UINT pppoeRetries; PCHAR pppoeACCookie; UINT pppoeACCookieLen;/* // misc stuff NDIS_HANDLE MiniportHandle; // NDIS Handle to for miniport up-calls NDIS_HANDLE SendPacketPoolHandle; NDIS_HANDLE RecvPacketPoolHandle; NDIS_STATUS Status; // Open Status NDIS_EVENT Event; // Used by bind/halt for Open/Close Adapter synch. NDIS_REQUEST Request; // This is used to wrap a request coming down // to us. This exploits the fact that requests // are serialized down to us. PULONG BytesNeeded; PULONG BytesReadOrWritten; BOOLEAN IndicateRcvComplete; BOOLEAN OutstandingRequests; //True - if a request has been passed to the miniport below the IM protocol BOOLEAN QueuedRequest; //True - if a request is queued with the IM miniport and needs to be either // failed or sent to the miniport below the IM Protocol BOOLEAN StandingBy; // True - When the miniport or protocol is transitioning from a D0 to Standby (>D0) State // False - At all other times, - Flag is cleared after a transition to D0 NDIS_DEVICE_POWER_STATE MPDeviceState; // Miniport's Device State NDIS_DEVICE_POWER_STATE PTDeviceState; // Protocol's Device State BOOLEAN IsLineOpen; ULONG ulLineStates; ULONG ulCurrentState; NDIS_STRING adapter_name;*/} ADAPT, *PADAPT, ADAPTER, *PADAPTER;#define PPPOE_POOL_SIZE 10extern PADAPTER AdapterCreate(void);extern void AdapterFree(PADAPTER);extern void AdapterLink(PADAPTER);extern void AdapterUnlink(PADAPTER);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -