Update of /cvsroot/dhcp-agent/dhcp-agent/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13475
Modified Files:
dhcp-server-states.c
Log Message:
added more skeleton code
Index: dhcp-server-states.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server-states.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** dhcp-server-states.c 7 Aug 2003 01:14:27 -0000 1.7
--- dhcp-server-states.c 2 Jun 2004 02:13:54 -0000 1.8
***************
*** 163,166 ****
--- 163,167 ----
lease_t *lease;
dhcp_obj *dhcp = sc->rawnet->dhcp_p;
+ char *eth_addr;
/* get the information from the dhcp packet which describes the client. */
***************
*** 170,175 ****
lease = lease_manager_lease_available(client_info);
! if(lease == NULL)
return STATE_LISTEN; /* we have no possible leases: we drop the packet. */
/* otherwise we do have a lease, send out an OFFER. */
--- 171,181 ----
lease = lease_manager_lease_available(client_info);
! if(lease == NULL) {
! eth_addr = eth_addr_to_string(client_info_get_chaddr(client_info));
! INFO_MESSAGE("No leases found for client: %s", eth_addr);
! xfree(eth_addr);
!
return STATE_LISTEN; /* we have no possible leases: we drop the packet. */
+ }
/* otherwise we do have a lease, send out an OFFER. */
***************
*** 220,223 ****
--- 226,231 ----
fd_set fd;
+ DEBUG_MESSAGE("getting next event...");
+
/* allow signal starvation if necessary, but we don't want to
* handle interrupts with gaps in between for everyime we
***************
*** 286,290 ****
***************************/
! /* server wait: this is the main server loop.
*
* We call server_next_event() and we
--- 294,298 ----
***************************/
! /* server listen: this is the main server loop.
*
* We call server_next_event() and we
***************
*** 303,315 ****
--- 311,327 ----
case SERVER_EVENT_LEASE_EXPIRE:
+ DEBUG_MESSAGE("doing event: LEASE EXPIRE");
return STATE_CLEAN_LEASES;
case SERVER_EVENT_DATA_WAITING:
+ DEBUG_MESSAGE("doing event: LEASE DATA WAITING");
return STATE_HANDLE_PACKET;
case SERVER_EVENT_USER_HUP:
+ DEBUG_MESSAGE("doing event: LEASE USER HUP");
return STATE_HUP;
case SERVER_EVENT_TERMINATE:
+ DEBUG_MESSAGE("doing event: TERMINATE");
return STATE_SHUTDOWN;
***************
*** 347,350 ****
--- 359,363 ----
case RAWNET_MALFORMED_PACKET:
+ DEBUG_MESSAGE("received malformed packet. ignoring..");
return STATE_LISTEN; /* if packet malformed, just ignore it. */
***************
*** 352,357 ****
/* check for a valid magic cookie, if not just drop it. */
! if(!dhcp_valid_magic_cookie(sc->rawnet->dhcp_p))
break;
/* based on the packet type, call the handler function. */
--- 365,372 ----
/* check for a valid magic cookie, if not just drop it. */
! if(!dhcp_valid_magic_cookie(sc->rawnet->dhcp_p)) {
! DEBUG_MESSAGE("received malformed packet. ignoring..");
break;
+ }
/* based on the packet type, call the handler function. */
|