Jump to main content

##

# TCPIP_DHCPS_HandlerRegister Function

## C

    TCPIP_DHCPS_EVENT_HANDLE TCPIP_DHCPS_HandlerRegister(TCPIP_NET_HANDLE hNet, TCPIP_DHCPS_EVENT_HANDLER handler,
    const void* hParam)

## Description

Registers a DHCP server Handler.

This function registers a DHCP event handler. The DHCP module will call the registered handler when a DHCP event (TCPIP_DHCPS_EVENT_TYPE) occurs.

## Precondition

The DHCPs module must be initialized.

## Parameters

Parameters | Description
--- | ---
hNet | selected interface handle
| use hNet == 0 to register on all interfaces available.
handler | Handler to be called when a DHCP event occurs.
hParam | Parameter to be used in the handler call.
| This is user supplied and is not used by the DHCP module.

## Returns

- a valid handle if the call succeeds

- a null handle if the call failed (out of memory, for example).

## Remarks

The handler has to be short and fast. It is meant for setting an event flag, not for lengthy processing!

The hParam is passed by the client and will be used by the DHCP when the notification is made. It is used for per-thread content or if more modules, for example, share the same handler and need a way to differentiate the callback.