| Kea 3.0.2-git

pkt_receive_co.cc File Reference

Defines the pkt4_receive and pkt6_receive callout functions. More...

`#include <config.h>`
`#include <hooks/hooks.h>`
`#include <dhcp/pkt4.h>`
`#include <dhcp/dhcp6.h>`
`#include <dhcp/pkt6.h>`
`#include <user_chk.h>`
Include dependency graph for pkt_receive_co.cc:

Go to the source code of this file.

## Functions
int | pkt4_receive (CalloutHandle &handle)
| This callout is called at the "pkt4_receive" hook.
int | pkt6_receive (CalloutHandle &handle)
| This callout is called at the "pkt6_receive" hook.

## Detailed Description

Defines the pkt4_receive and pkt6_receive callout functions.

Definition in file pkt_receive_co.cc.

## Function Documentation

## ◆ pkt4_receive()

int pkt4_receive | ( | CalloutHandle & | handle | ) |

This callout is called at the "pkt4_receive" hook.

This function determines if the DHCP client identified by the inbound DHCP query packet is in the user registry. Upon entry, the registry is refreshed. Next the hardware address is extracted from query and saved to the context as the "query_user_id". This id is then used to search the user registry. The resultant UserPtr whether the user is found or not, is saved to the callout context as "registered_user". This makes the registered user, if not null, available to subsequent callouts.

Parameters

  handle | CalloutHandle which provides access to context.

Returns
  0 upon success, non-zero otherwise.

Definition at line 40 of file pkt_receive_co.cc.

References isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, query_user_id_label, registered_user_label, isc::hooks::CalloutHandle::setContext(), and user_registry.

Here is the call graph for this function:

## ◆ pkt6_receive()

int pkt6_receive | ( | CalloutHandle & | handle | ) |

This callout is called at the "pkt6_receive" hook.

This function determines if the DHCP client identified by the inbound DHCP query packet is in the user registry. Upon entry, the registry is refreshed. Next the DUID is extracted from query and saved to the context as the "query_user_id". This id is then used to search the user registry. The resultant UserPtr whether the user is found or not, is saved to the callout context as "registered_user". This makes the registered user, if not null, available to subsequent callouts.

Parameters

  handle | CalloutHandle which provides access to context.

Returns
  0 upon success, non-zero otherwise.

Definition at line 98 of file pkt_receive_co.cc.

References D6O_CLIENTID, isc::hooks::CalloutHandle::getArgument(), isc::hooks::CalloutHandle::getStatus(), CalloutHandle::NEXT_STEP_DROP, CalloutHandle::NEXT_STEP_SKIP, query_user_id_label, registered_user_label, isc::hooks::CalloutHandle::setContext(), and user_registry.

Here is the call graph for this function: