Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Macros | Functions
dhcpRecvReply.c File Reference
#include <device.h>
#include "dhcp.h"
#include <ether.h>
#include <ipv4.h>
#include <network.h>
#include <string.h>
#include <stdlib.h>
#include <udp.h>
#include <thread.h>
#include <core.h>

Macros

#define DHCP_RECV_STKSIZE   NET_THR_STK
 
#define DHCP_RECV_PRIO   NET_THR_PRIO
 
#define DHCP_DROP_PACKET_PERCENT   0
 

Functions

syscall dhcpRecvReply (int descrp, struct dhcpData *data, uint timeout)
 

Function Documentation

syscall dhcpRecvReply ( int  descrp,
struct dhcpData *  data,
uint  timeout 
)

Wait, with timeout, for a response from a DHCP server and update the DHCP transfer data. The exact behavior of this function depends on the current DHCP client state:

  • If in DHCPC_STATE_SELECTING, the client waits until it gets a DHCPOFFER reply from any server.
  • If in DHCPC_STATE_REQUESTING, the client waits until it gets a DHCPACK or DHCPNAK reply from the server to which it sent the DHCPREQUEST.
Parameters
[in]descrpNetwork device on which to wait for a response.
[in,out]dataDHCP transfer data.
[in]timeoutMilliseconds to wait before timing out.
Returns
OK if successful; TIMEOUT if timed out; SYSERR if other error occurred.