NetBurner 3.1
ppp.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
28 #ifndef _NB_PPP_H
29 #define _NB_PPP_H
30 
31 #ifndef NB_NET_TYPES_H
32 #include "nettypes.h"
33 #endif
34 
35 #ifndef _NB_BUFFERS_H
36 #include "buffers.h"
37 #endif
38 
45 struct pppoptions
46 {
47  uint8_t Restart_Interval;
48  uint8_t Max_Terminate;
49  uint8_t Max_Configure;
50  uint8_t Max_Failure;
51  BOOL CHAPenable;
52 
53  // If you require authentication from the peer, then pass in the function to
54  // call for authentication. A non zero value means the passed in name, password is ok
55 
57  int (*authenticate_func)(const char *name, const char *passwd);
58  const char *pUserName;
59  const char *pPassword;
62  IPADDR4 ActualThisInterfaceAddress;
63  IPADDR4 ActualThatInterfaceAddress;
64  IPADDR4 RecievedDNSAddress;
65 
66 
67  uint32_t dwflags;
68  uint16_t MRU;
69  uint32_t TX_ACCM;
70  uint32_t RX_ACCM;
71 
72  uint32_t TX_DESIRED_ACCM;
73  uint32_t RX_DESIRED_ACCM;
74 
76 };
78 
84 typedef enum
85 {
100 
105 #define ERR_PPP_SUCCESS (0)
106 #define ERR_PPP_ALREADY_OPEN (-1)
107 #define ERR_PPP_NO_DIALTONE (-2)
108 #define ERR_PPP_NO_ANSWER (-3)
109 #define ERR_PPP_BUSY (-4)
110 #define ERR_PPP_FAIL (-5)
111 #define ERR_PPP_PASSFAIL (-6)
112 #define ERR_PPP_LOSTCARRIER (-7)
113 #define ERR_PPP_NO_MODEM (-8)
114 #define ERR_PPP_LCP_FAILED (-9)
115 #define ERR_PPP_CHAPFAIL (-10)
116 
118 
130 int food(int i);
131 int StartPPPDaemon(int serial_port, pppoptions *popt);
132 
144 int StartPPPDirect(int serial_port, pppoptions *popt);
145 
151 void StopPPPDaemon();
152 
163 int DialPPP(int serial_port, pppoptions *popt, const char *dial_string);
164 
175 int DirectConnectPPP(int serial_port, pppoptions *popt, const char *dial_string);
176 
184 
188 void ClosePPPSesion();
189 
190 IPADDR4 GetThatPPP_IP();
191 IPADDR4 GetThisPPP_IP();
192 IPADDR4 GetPPP_DNS();
193 
194 
195 void SendCHAPChallenge();
196 
197 extern volatile uint32_t PPP_BAUDRATE_TO_USE;
198 extern volatile BOOL PPP_SW_RX_FLOW;
199 extern volatile BOOL PPP_SW_TX_FLOW;
200 extern const char *MODEM_INITSTRING;
201 extern const char *MODEM_ENDCMDMODE;
202 extern const char *MODEM_POSTDIAL;
203 extern const char *MODEM_ATTNSTRING;
204 extern const char *MODEM_AUTOBAUD;
205 extern const char *MODEM_RESET;
206 extern const char *MODEM_ANSWER;
207 extern const char *MODEM_HANGSTRING;
208 
209 #endif
210 
uint8_t Max_Terminate
The Maximum number of times to send terminate.
Definition: ppp.h:48
Answering incomming connection.
Definition: ppp.h:90
enum_PPPState GetPPPState()
Returns the current state of the PPP connection.
Definition: ppp.cpp:720
LCP negotiation.
Definition: ppp.h:92
Connection closing.
Definition: ppp.h:97
NCP negotiation.
Definition: ppp.h:95
void ClosePPPSesion()
Close the PPP session.
Definition: ppp.cpp:712
uint8_t Max_Failure
The Maximum number of configuration failures.
Definition: ppp.h:50
Initializing modem.
Definition: ppp.h:87
int food(int i)
Start the PPP daemon and listen for incoming connections. Use when connected to a modem...
CHAP authentication.
Definition: ppp.h:94
Connection open.
Definition: ppp.h:96
BOOL CHAPenable
If set to true, CHAP will be required for the connection.
Definition: ppp.h:51
uint8_t Restart_Interval
The restart interval for PPP Negotiations, specified in seconds.
Definition: ppp.h:47
Waiting for ring indicator.
Definition: ppp.h:89
Connection closed.
Definition: ppp.h:86
Waiting for train.
Definition: ppp.h:91
IPADDR4 SetThatInterfaceAddress
A valid IP address will be used as the remote client's IP address.
Definition: ppp.h:61
const char * pPassword
Password for PAP autentication.
Definition: ppp.h:59
enum_PPPState
Definition: ppp.h:84
int StartPPPDirect(int serial_port, pppoptions *popt)
Start the PPP daemon and listen for incoming connections. Use with a direct serial connection...
Definition: ppp.cpp:2722
void StopPPPDaemon()
Stop the PPP daemon.
Definition: ppp.cpp:704
uint8_t Max_Configure
The Maximum number of times to send config requests.
Definition: ppp.h:49
int DialPPP(int serial_port, pppoptions *popt, const char *dial_string)
Make an outgoing connection using the specified phone number.
Definition: ppp.cpp:2641
uint32_t RX_DESIRED_ACCM
Set any additional receive ACCM values.
Definition: ppp.h:73
const char * pUserName
User name for PAP autentication.
Definition: ppp.h:58
Structure to specify PPP options.
Definition: ppp.h:45
Dialing.
Definition: ppp.h:88
PAP authentication.
Definition: ppp.h:93
NetBurner Buffers API.
BOOL Chat_Login_disable
If set to true, then ppp will not allow Chat_Login mode to occur.
Definition: ppp.h:56
IPADDR4 SetThisInterfaceAddress
A value of 0 will require the remote client to provide an IP address.
Definition: ppp.h:60
int DirectConnectPPP(int serial_port, pppoptions *popt, const char *dial_string)
Make an outgoing connection using a direct connection.
Definition: ppp.cpp:2862
uint32_t TX_DESIRED_ACCM
Set any additional transmit ACCM values.
Definition: ppp.h:72
BOOL UseMagicNumber
Set to enable a magic number.
Definition: ppp.h:75