messageReceived

The messageReceived routine lets you add an external means of authentication to each received DHCP or BOOTP message.

The routine is called just as the message is received by the protocol processor and before any parsing of the message itself.

In addition to the message, the server passes three IP addresses to the routine. These addresses, when used together, can determine whether the client is on a locally attached network or a remotely routed network and whether the server is receiving a broadcast message.

Additionally, you can use the messageReceived routine to alter the received message. Because changes directly affect the remainder of message processing, use this ability rarely and only under well-understood circumstances.

The following is the structure of the messageReceived routine:

int messageReceived  ( caddr_t hObjectInstance,
                       struct dhcpmessage **inMessage,
                       size_t *messageSize,
                       const struct in_addr *receivingIP,
                       const struct in_addr *destinationIP,
                       const struct in_addr *sourceIP         ) ;
Where:
Item Description
hObjectInstance Is the same configuration instance handle created when this object was initialized.
inMessage Is a pointer to the unaltered, incoming DHCP or BOOTP message.
messageSize Is the total length, in bytes, of the received DHCP or BOOTP message.
receivingIP Is the IP address of the interface receiving the DHCP or BOOTP message.
destinationIP Is the destination IP address taken from the IP header of the received DHCP or BOOTP message.
sourceIP Is the source IP address taken from the IP header of the received DHCP or BOOTP message.
The messageReceived routine returns one of the following values:
Item Description
0 (zero) The received message can continue to be parsed and the client possibly offered or given an address through the regular means of the DHCP server.
!= 0 (non-zero) The source client of this message is not to be given any response from this server. This server remains silent to the client.