ISC DHCP 4.4.3-P1
A reference DHCPv4 and DHCPv6 implementation
 
Loading...
Searching...
No Matches
client_tables.c
Go to the documentation of this file.
1/* client_tables.c
2
3 Tables of information only used by client... */
4
5/*
6 * Copyright (C) 2017-2022 Internet Systems Consortium, Inc. ("ISC")
7 *
8 * This Source Code Form is subject to the terms of the Mozilla Public
9 * License, v. 2.0. If a copy of the MPL was not distributed with this
10 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
18 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 *
20 * Internet Systems Consortium, Inc.
21 * PO Box 360
22 * Newmarket, NH 03857 USA
23 * <info@isc.org>
24 * https://www.isc.org/
25 *
26 */
27
28#include "dhcpd.h"
29
31static struct option client_options[] = {
32 /* @todo dummy-client-parm should be removed with the first real param */
33 { "dummy-client-parm", "T", &client_universe, 1, 1 },
34 { NULL, NULL, NULL, 0, 0 }
35};
36
37#define CLIENT_HASH_SIZE (2*(sizeof(client_options) / sizeof(struct option)))
38
40{
41 int i;
42
43 /* Set up the client option universe... */
44 client_universe.name = "client";
45 client_universe.concat_duplicates = 0;
47 client_universe.option_state_dereference =
53 client_universe.length_size = 1; /* Never used ... */
54 client_universe.tag_size = 4;
55 client_universe.store_tag = putUChar;
56 client_universe.store_length = putUChar;
57 client_universe.site_code_min = 0;
58 client_universe.end = 0;
61 if (!option_name_new_hash(&client_universe.name_hash,
63 !option_code_new_hash(&client_universe.code_hash,
65 log_fatal ("Can't allocate client option hash table.");
66 for (i = 0 ; client_options[i].name ; i++) {
67 option_code_hash_add(client_universe.code_hash,
68 &client_options[i].code, 0,
69 &client_options[i], MDL);
70 option_name_hash_add(client_universe.name_hash,
71 client_options[i].name, 0,
72 &client_options[i], MDL);
73 }
74
75 /* Add the client option space to the option space hash. */
76 universe_hash_add (universe_hash,
78
79 /* Make the client universe the configuration option universe. */
81}
#define CLIENT_HASH_SIZE
void initialize_client_option_spaces()
struct universe client_universe
void save_hashed_option(struct universe *universe, struct option_state *options, struct option_cache *oc, isc_boolean_t appendp)
Definition options.c:2839
int hashed_option_space_encapsulate(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *universe)
Definition options.c:3249
int hashed_option_state_dereference(struct universe *universe, struct option_state *state, const char *file, int line)
Definition options.c:3003
void hashed_option_space_foreach(struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct universe *u, void *stuff, void(*func)(struct option_cache *, struct packet *, struct lease *, struct client_state *, struct option_state *, struct option_state *, struct binding_scope **, struct universe *, void *))
Definition options.c:3832
struct option_cache * lookup_hashed_option(struct universe *universe, struct option_state *options, unsigned code)
Definition options.c:2518
void delete_hashed_option(struct universe *universe, struct option_state *options, int code)
Definition options.c:2918
void putUChar(unsigned char *, u_int32_t)
Definition convert.c:102
#define MDL
Definition omapip.h:567
void log_fatal(const char *,...) __attribute__((__format__(__printf__
Definition tree.h:345
struct universe * config_universe
Definition tables.c:982
int universe_count
Definition tables.c:976
universe_hash_t * universe_hash
Definition tables.c:974
struct universe ** universes
Definition tables.c:975