grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / networks / ppp / ppp.h
blobcb8e67aa2bb76da2ef684dbc1bae39eeab6f0dd6
1 /*
2 * $Id$
3 */
5 #ifndef _PPP_H
6 #define _PPP_H
8 #define DEBUG 1
10 #include <exec/types.h>
11 #include <exec/libraries.h>
12 #include <exec/semaphores.h>
13 #include <exec/devices.h>
14 #include <exec/interrupts.h>
15 #include <dos/bptr.h>
17 #include <oop/oop.h>
19 #include <hidd/pci.h>
21 #include <devices/timer.h>
22 #include <devices/sana2.h>
23 #include <devices/sana2specialstats.h>
25 #include <proto/exec.h>
26 #include <proto/dos.h>
27 #include <aros/debug.h>
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <ctype.h>
33 #include LC_LIBDEFS_FILE
37 ** Maximum Transmission Unit
39 #define PPP_MTU 1500
42 ** Max # of Units allowed
44 #define SD_MAXUNITS 1
46 #define PPP_MAXBUFF 4096
47 #define SERIAL_BUFSIZE PPP_MAXBUFF
48 #define PPP_MAXARGLEN 100
50 // phases
51 #define PPP_PHASE_DEAD 1
52 #define PPP_PHASE_CONFIGURATION 2
53 #define PPP_PHASE_AUTHENTICATION 3
54 #define PPP_PHASE_PROTOCOL_CONF 4
55 #define PPP_PHASE_NETWORK 5
56 #define PPP_PHASE_TERMINATE 6
58 // PPPcontrolMsg commands
59 #define PPP_CTRL_INFO_REQUEST 1
60 #define PPP_CTRL_INFO 2
61 #define PPP_CTRL_SETPHASE 3
62 #define PPP_CTRL_OPEN_SERIAL 4
63 #define PPP_CTRL_CLOSE_SERIAL 5
65 struct PPPcontrolMsg{
67 struct Message Msg;
69 ULONG Command; // command
70 IPTR Arg; // command argument
72 UBYTE *DeviceName; // serial device name
73 ULONG UnitNum; // serial device unit number
74 UBYTE *username;
75 UBYTE *password;
77 // info response part:
78 UBYTE Phase; // ppp phase
79 BOOL Ser; // serial device status
80 BOOL Up; // ppp device up/down
81 ULONG BytesIn;
82 ULONG BytesOut;
83 ULONG SpeedIn;
84 ULONG SpeedOut;
85 ULONG UpTime;
87 UBYTE LocalIP[4];
88 UBYTE RemoteIP[4];
89 UBYTE PrimaryDNS[4];
90 UBYTE SecondaryDNS[4];
92 ULONG num; // message number (debug purposes)
95 struct at_command {
96 struct Node cNode;
97 BYTE command,arg;
98 BYTE str[PPP_MAXARGLEN];
101 struct EasyTimer{
102 struct MsgPort *TimeMsg;
103 struct timerequest *TimeReq;
106 struct EasySerial{
107 struct IOExtSer *SerRx; /* Serial IORequest for CMD_READ's */
108 struct IOExtSer *SerTx; /* Serial IORequest for CMD_WRITE's */
109 struct MsgPort *RxPort; /* Serial CMD_READ IORequest reply port */
110 struct MsgPort *TxPort; /* Serial CMD_WRITE IORequest reply port */
111 UBYTE *RxBuff; /* Buffer for holding incoming data */
112 UBYTE *TxBuff; /* Buffer for hold outgoing packets */
113 BOOL Ok; // is device ok (= not unplugged)
116 struct PPPBase {
117 struct Device sd_Device;
118 ULONG sd_OpenCnt;
119 UBYTE sd_Flags;
121 BOOL device_up;
122 BOOL sdu_Proc_run;
124 ULONG gui_message;
126 struct Unit *sd_Unit;
127 struct SignalSemaphore sd_Lock;
129 struct Process *sdu_Proc;
131 struct EasySerial *ser;
133 BYTE DeviceName[PPP_MAXARGLEN];
134 BYTE SerUnitNum;
135 BYTE username[PPP_MAXARGLEN];
136 BYTE password[PPP_MAXARGLEN];
138 BOOL (*CopyFromBuffer)(APTR, APTR, ULONG);
139 BOOL (*CopyToBuffer)(APTR, APTR, ULONG);
141 struct SignalSemaphore sdu_ListLock; /* A Semaphore for access to all of our queues. */
142 struct MinList Rx_List; /* Pending CMD_READ's */
143 struct MinList Tx_List; /* Pending CMD_WRITE's */
145 ULONG BytesIn;
146 ULONG BytesOut;
147 ULONG SpeedIn;
148 ULONG SpeedOut;
149 ULONG UpTime;
151 UBYTE LocalIP[4];
152 UBYTE RemoteIP[4];
153 UBYTE PrimaryDNS[4];
154 UBYTE SecondaryDNS[4];
159 #endif