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

/opentcp/bootp/bootp.c File Reference


Detailed Description

Author:
Version:
1.0
Date:
10.7.2002
Bug:
Warning:
Todo:
OpenTCP BOOTP client protocol implementation. Function declarations can be found in inet/bootp/bootp.h

Definition in file bootp.c.

Go to the source code of this file.

Functions

INT8 bootpc_init (UINT8 mode)
 Initializes BOOTP client.

void bootpc_stop (void)
 Stop BOOTP client operation.

INT8 bootpc_enable (void)
 Enable BOOTP client operation.

void bootpc_run (void)
 BOOTP client main loop.

INT32 bootpc_eventlistener (INT8 cbhandle, UINT8 event, UINT32 remip, UINT16 remport, UINT16 bufindex, UINT16 dlen)
 BOOTP event listener.


Variables

UINT8 bootp_app_init = 0
struct {
bootp
 BOOTP client information.


Function Documentation

INT8 bootpc_init UINT8    mode
 

Author:
Date:
19.07.2002
Returns:
  • -1 - Error during initialization
  • >=0 - OK
Invoke this function to initialize BOOTP client. This will also trigger BOOTP address-fetching procedure.

Definition at line 108 of file bootp.c.

References bootp, bootp_app_init, BOOTP_CLIENTPORT, bootpc_eventlistener(), BOOTPC_STATE_DISABLED, get_timer(), udp_getsocket(), udp_open(), UDP_OPT_CHECK_CS, and UDP_OPT_SEND_CS.

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.

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_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().


Variable Documentation

UINT8 bootp_app_init = 0
 

Defines whether bootpc_init has already been invoked or not

Definition at line 77 of file bootp.c.

Referenced by bootpc_enable(), bootpc_eventlistener(), bootpc_init(), bootpc_run(), and bootpc_stop().

struct { ... } bootp
 

bootp variable holds various information about the BOOTP client and also information needed by the BOOTP client to function properly.

Referenced by bootpc_enable(), bootpc_eventlistener(), bootpc_init(), bootpc_run(), and bootpc_stop().


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