summaryrefslogtreecommitdiffstats
path: root/src/hooks/dhcp/bootp/bootp.dox
blob: 5b34caf691237ff0c2c2faeb794970ab6c745aea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright (C) 2019-2021 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

/**

@page libdhcp_bootp Kea Bootp Hooks Library

@section libdhcp_bootpIntro Introduction

Welcome to Kea Bootp Hooks Library. This documentation is addressed to
developers who are interested in the internal operation of the Bootp
library. This file provides information needed to understand and
perhaps extend this library.

This documentation is stand-alone: you should have read and understood
the <a href="https://reports.kea.isc.org/dev_guide/">Kea
Developer's Guide</a> and in particular its section about hooks.

@section libdhcp_bootpUser Now To Use libdhcp_bootp
## Introduction
libdhcp_bootp is a hooks library which allows the processing
of BOOTP queries following the RFC1497. Old RFC951 BOOTP queries
without vendor extensions are not supported.

## Configuring the DHCPv4 Module

It must be configured as a hook library for the desired DHCP server
modules. Note that the bootp library is installed alongside the
Kea libraries in "<install-dir>/lib" where <install-dir> is determined
by the --prefix option of the configure script.  It defaults to
"/usr/local". Assuming the default value then, configuring kea-dhcp4
to load the bootp library could be done with the following Kea4
configuration:

@code
"Dhcp4": {
    "hooks-libraries": [
        {   "library": "/usr/local/lib/libdhcp_bootp.so" },
        ...
    ]
}
@endcode

No parameter is defined.

## Internal operation

The first function called in @ref load() located in the
bootp_callouts.cc. It checks if the necessary parameter is passed and
decodes the option configurations. @ref unload() free the configuration.

Kea engine checks if the library has functions that match known hook
point names. This library has two such functions: @ref buffer4_receive
and @ref pkt4_send located in bootp_callouts.cc.

If the receive query has no dhcp-message-type option then it is a BOOTP
one: the BOOTP client class and a DHCPREQUEST dhcp-message-type option
are added to the BOOTP query.

On the outgoing side dhcp-message-type and other DHCP specific options
are removed from the response. When the packed response is shorter than
the BOOTP minimum size (300 octets) it is padded after the END option
by nuls up to this size.

In case any other library sets the SKIP flag before pkt4_send, an exception
with the message "the packet pack already handled" will be thrown, to
indicate that the action can not be properly performed.
To fix this, all other libraries which might set the SKIP flag must appear
in the server configuration after this library.

@section libdhcp_bootpMTCompatibility Multi-Threading Compatibility

The Bootp hooks library is compatible with multi-threading.

*/