Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/include/inet/bootp/bootp.h File Reference


Detailed Description

Author:
Version:
1.0
Date:
10.7.2002
OpenTCP BOOTP client function declarations, constants, etc.

Definition in file bootp.h.

Go to the source code of this file.

Defines

#define BOOTP_RETRY_TOUT   5
#define BOOTP_CLIENTPORT   68
#define BOOTP_SERVERPORT   67
#define BOOTPC_STATE_DISABLED   0
#define BOOTPC_STATE_ENABLED   1
#define BOOTPC_STATE_REQUEST_NEEDED   2
#define BOOTPC_STATE_WAITING_REPLY   3
#define BOOTPC_STATE_REPLY_GET   4
#define BOOTP_OPTION_SUBNETMASK   1
#define BOOTP_OPTION_DEFGW   3

Functions

INT8 bootpc_enable (void)
 Enable BOOTP client operation.

void bootpc_stop (void)
 Stop BOOTP client operation.

void bootpc_run (void)
 BOOTP client main loop.

INT32 bootpc_eventlistener (INT8, UINT8, UINT32, UINT16, UINT16, UINT16)
 BOOTP event listener.


Define Documentation

#define BOOTP_RETRY_TOUT   5
 

How many seconds to pass before retrying

Definition at line 69 of file bootp.h.

Referenced by bootpc_run().

#define BOOTP_CLIENTPORT   68
 

Local BOOTP client port that will be used for sending requests

Definition at line 71 of file bootp.h.

Referenced by bootpc_init().

#define BOOTP_SERVERPORT   67
 

BOOTP server's port

Definition at line 73 of file bootp.h.

Referenced by bootpc_run().

#define BOOTPC_STATE_DISABLED   0
 

BOOTP client intentionally disabled

Definition at line 75 of file bootp.h.

Referenced by bootpc_init(), and bootpc_stop().

#define BOOTPC_STATE_ENABLED   1
 

BOOTP initialized and waiting to send initial BOOTP request

Definition at line 76 of file bootp.h.

Referenced by bootpc_enable(), and bootpc_run().

#define BOOTPC_STATE_REQUEST_NEEDED   2
 

New (or first) BOOTP requests must be issued

Definition at line 79 of file bootp.h.

Referenced by bootpc_run().

#define BOOTPC_STATE_WAITING_REPLY   3
 

After issuing the request BOOTP is in this state waiting either for timeout or a response from the BOOTP server

Definition at line 82 of file bootp.h.

Referenced by bootpc_eventlistener(), and bootpc_run().

#define BOOTPC_STATE_REPLY_GET   4
 

Once we get into this state, proper reply has been received from the BOOTP server

Definition at line 87 of file bootp.h.

Referenced by bootpc_eventlistener(), and bootpc_run().

#define BOOTP_OPTION_SUBNETMASK   1
 

Subnet mask option BOOTP client is waiting for in the reply from the BOOTP server

Definition at line 93 of file bootp.h.

Referenced by bootpc_eventlistener().

#define BOOTP_OPTION_DEFGW   3
 

Default gateway option BOOTP client is waiting for in the reply from the BOOTP server

Definition at line 97 of file bootp.h.

Referenced by bootpc_eventlistener().


Function Documentation

INT8 bootpc_enable void   
 

Author:
Date:
09.10.2002
Invoke this function to enable BOOTP client operation.

Definition at line 165 of file bootp.c.

References bootp, bootp_app_init, and BOOTPC_STATE_ENABLED.

void bootpc_stop void   
 

Author:
Date:
09.10.2002
Invoke this function to disable BOOTP client operation once it is not needed any more or just to temporarily suspend it's operation.

Definition at line 150 of file bootp.c.

References bootp, bootp_app_init, and BOOTPC_STATE_DISABLED.

void bootpc_run void   
 

Author:
Date:
07.10.2002
Main thread of the BOOTP client that should be invoked periodically.

Definition at line 183 of file bootp.c.

References bootp, bootp_app_init, BOOTP_RETRY_TOUT, BOOTP_SERVERPORT, BOOTPC_STATE_ENABLED, BOOTPC_STATE_REPLY_GET, BOOTPC_STATE_REQUEST_NEEDED, BOOTPC_STATE_WAITING_REPLY, check_timer(), init_timer(), NETWORK_TX_BUFFER_SIZE, TIMERTIC, UDP_APP_OFFSET, and udp_send().

INT32 bootpc_eventlistener INT8    cbhandle,
UINT8    event,
UINT32    remip,
UINT16    remport,
UINT16    bufindex,
UINT16    dlen
 

Author:
Date:
07.10.2002
Parameters:
cbhandle  handle of the socket this packet is intended for.
event  event that is notified. For UDP, only UDP_EVENT_DATA.
ipaddr  IP address of remote host who sent the UDP datagram
port  port number of remote host who sent the UDP datagram
buffindex  buffer index in RTL8019AS
Returns:
  • - 1 - error in processing
  • >0 - BOOTP reply successfully processed
Note:
  • Event listeners are NOT to be invoked directly. They are callback functions invoked by the TCP/IP stack to notify events.
Analyze received UDP packet and see if it contains what we need. If yes, get new network settings.

Definition at line 335 of file bootp.c.

References bootp, bootp_app_init, BOOTP_OPTION_DEFGW, BOOTP_OPTION_SUBNETMASK, BOOTPC_STATE_REPLY_GET, BOOTPC_STATE_WAITING_REPLY, NETWORK_RECEIVE_INITIALIZE, and RECEIVE_NETWORK_B.

Referenced by bootpc_init().


Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by doxygen1.2.18