37 int keep_capabilities = 0;
40 #ifdef HAVE_LIBSYSTEMD 41 #include <systemd/sd-daemon.h> 91 isc_boolean_t use_if_id = ISC_FALSE;
110 struct sockaddr_in
to;
117 struct stream_list *
next;
119 struct sockaddr_in6 link;
121 } *downstreams, *upstreams;
123 static struct stream_list *parse_downstream(
char *);
124 static struct stream_list *parse_upstream(
char *);
125 static void setup_streams(
void);
133 char *dhcrelay_sub_id = NULL;
137 unsigned int,
unsigned int,
struct iaddr,
142 static int find_interface_by_agent_option(
struct dhcp_packet *,
148 static const char copyright[] =
149 "Copyright 2004-2016 Internet Systems Consortium.";
150 static const char arr[] =
"All rights reserved.";
151 static const char message[] =
152 "Internet Systems Consortium DHCP Relay Agent";
153 static const char url[] =
154 "For info, please visit https://www.isc.org/software/dhcp/";
159 #define DHCRELAY_USAGE \ 160 "Usage: %s [-4] [-d] [-q] [-a] [-D]\n"\ 161 " [-A <length>] [-c <hops>] [-p <port>]\n" \ 162 " [-pf <pid-file>] [--no-pid]\n"\ 163 " [-m append|replace|forward|discard]\n" \ 164 " [-i interface0 [ ... -i interfaceN]\n" \ 165 " [-U interface]\n" \ 166 " server0 [ ... serverN]\n\n" \ 167 " %s -6 [-d] [-q] [-I] [-c <hops>] [-p <port>]\n" \ 168 " [-pf <pid-file>] [--no-pid]\n" \ 169 " [-s <subscriber-id>]\n" \ 170 " -l lower0 [ ... -l lowerN]\n" \ 171 " -u upper0 [ ... -u upperN]\n" \ 172 " lower (client link): [address%%]interface[#index]\n" \ 173 " upper (server link): [address%%]interface" 175 #define DHCRELAY_USAGE \ 176 "Usage: %s [-d] [-q] [-a] [-D] [-A <length>] [-c <hops>] [-p <port>]\n" \ 177 " [-pf <pid-file>] [--no-pid]\n" \ 178 " [-m append|replace|forward|discard]\n" \ 179 " [-i interface0 [ ... -i interfaceN]\n" \ 180 " [-U interface]\n" \ 181 " server0 [ ... serverN]\n\n" 199 static const char use_noarg[] =
"No argument for command: %s";
201 static const char use_badproto[] =
"Protocol already set, %s inappropriate";
202 static const char use_v4command[] =
"Command not used for DHCPv6: %s";
203 static const char use_v6command[] =
"Command not used for DHCPv4: %s";
207 usage(
const char *sfmt,
const char *sarg) {
210 #ifdef PRINT_SPECIFIC_CL_ERRORS 228 char *service_local = NULL, *service_remote = NULL;
229 u_int16_t port_local = 0, port_remote = 0;
234 struct stream_list *sl = NULL;
235 int local_family_set = 0;
247 fd = open(
"/dev/null", O_RDWR | O_CLOEXEC);
249 fd = open(
"/dev/null", O_RDWR | O_CLOEXEC);
251 fd = open(
"/dev/null", O_RDWR | O_CLOEXEC);
260 setlogmask(LOG_UPTO(LOG_INFO));
266 if (status != ISC_R_SUCCESS)
267 log_fatal(
"Can't initialize context: %s",
268 isc_result_totext(status));
272 if (status != ISC_R_SUCCESS)
274 isc_result_totext(status));
279 for (i = 1; i < argc; i++) {
280 if (!strcmp(argv[i],
"-4")) {
283 usage(use_badproto,
"-4");
285 local_family_set = 1;
287 }
else if (!strcmp(argv[i],
"-6")) {
289 usage(use_badproto,
"-6");
291 local_family_set = 1;
294 }
else if (!strcmp(argv[i],
"-d")) {
296 }
else if (!strcmp(argv[i],
"-q")) {
299 }
else if (!strcmp(argv[i],
"-p")) {
301 usage(use_noarg, argv[i-1]);
303 log_debug(
"binding to user-specified port %d",
305 }
else if (!strcmp(argv[i],
"-c")) {
308 usage(use_noarg, argv[i-1]);
309 hcount = atoi(argv[i]);
313 usage(
"Bad hop count to -c: %s", argv[i]);
314 }
else if (!strcmp(argv[i],
"-i")) {
317 usage(use_v4command, argv[i]);
319 local_family_set = 1;
323 usage(use_noarg, argv[i-1]);
325 if (strlen(argv[i]) >=
sizeof(tmp->
name)) {
328 argv[i], (
long)strlen(argv[i]));
330 status = interface_allocate(&tmp,
MDL);
331 if (status != ISC_R_SUCCESS) {
334 isc_result_totext(status));
336 strcpy(tmp->
name, argv[i]);
338 interface_dereference(&tmp,
MDL);
339 }
else if (!strcmp(argv[i],
"-a")) {
342 usage(use_v4command, argv[i]);
344 local_family_set = 1;
348 }
else if (!strcmp(argv[i],
"-A")) {
351 usage(use_v4command, argv[i]);
353 local_family_set = 1;
357 usage(use_noarg, argv[i-1]);
363 "longest possible MTU\n",
365 }
else if (!strcmp(argv[i],
"-m")) {
368 usage(use_v4command, argv[i]);
370 local_family_set = 1;
374 usage(use_noarg, argv[i-1]);
375 if (!strcasecmp(argv[i],
"append")) {
377 }
else if (!strcasecmp(argv[i],
"replace")) {
379 }
else if (!strcasecmp(argv[i],
"forward")) {
381 }
else if (!strcasecmp(argv[i],
"discard")) {
384 usage(
"Unknown argument to -m: %s", argv[i]);
385 }
else if (!strcmp(argv [i],
"-U")) {
387 usage(use_noarg, argv[i-1]);
390 usage(
"more than one uplink (-u) specified: %s" 395 status = interface_allocate(&uplink,
MDL);
396 if (status != ISC_R_SUCCESS) {
397 log_fatal(
"%s: uplink interface_allocate: %s",
398 argv[i], isc_result_totext(status));
401 if (strlen(argv[i]) >=
sizeof(uplink->
name)) {
403 " it cannot exceed: %ld characters",
404 argv[i], (
long)(
sizeof(uplink->
name) - 1));
407 uplink->
name[
sizeof(uplink->
name) - 1] = 0x00;
408 strncpy(uplink->
name, argv[i],
409 sizeof(uplink->
name) - 1);
415 }
else if (!strcmp(argv[i],
"-D")) {
418 usage(use_v4command, argv[i]);
420 local_family_set = 1;
425 }
else if (!strcmp(argv[i],
"-I")) {
427 usage(use_v6command, argv[i]);
429 local_family_set = 1;
431 use_if_id = ISC_TRUE;
432 }
else if (!strcmp(argv[i],
"-l")) {
434 usage(use_v6command, argv[i]);
436 local_family_set = 1;
438 if (downstreams != NULL)
439 use_if_id = ISC_TRUE;
441 usage(use_noarg, argv[i-1]);
442 sl = parse_downstream(argv[i]);
443 sl->next = downstreams;
445 }
else if (!strcmp(argv[i],
"-u")) {
447 usage(use_v6command, argv[i]);
449 local_family_set = 1;
452 usage(use_noarg, argv[i-1]);
453 sl = parse_upstream(argv[i]);
454 sl->next = upstreams;
456 }
else if (!strcmp(argv[i],
"-s")) {
458 usage(use_v6command, argv[i]);
460 local_family_set = 1;
463 usage(use_noarg, argv[i-1]);
464 dhcrelay_sub_id = argv[i];
466 }
else if (!strcmp(argv[i],
"-nc")) {
467 #ifdef HAVE_LIBCAP_NG 468 keep_capabilities = 1;
470 }
else if (!strcmp(argv[i],
"-pf")) {
472 usage(use_noarg, argv[i-1]);
475 }
else if (!strcmp(argv[i],
"--no-pid")) {
477 }
else if (!strcmp(argv[i],
"--version")) {
480 }
else if (!strcmp(argv[i],
"--help") ||
481 !strcmp(argv[i],
"-h")) {
488 }
else if (argv[i][0] ==
'-') {
489 usage(
"Unknown command: %s", argv[i]);
492 struct in_addr ia, *iap = NULL;
496 usage(use_v4command, argv[i]);
498 local_family_set = 1;
501 if (inet_aton(argv[i], &ia)) {
504 he = gethostbyname(argv[i]);
508 iap = ((
struct in_addr *)
520 memcpy(&sp->
to.sin_addr, iap,
sizeof *iap);
544 #ifdef HAVE_LIBCAP_NG 546 if (!keep_capabilities) {
547 capng_clear(CAPNG_SELECT_BOTH);
548 capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE|CAPNG_PERMITTED,
549 CAP_NET_RAW, CAP_NET_BIND_SERVICE, -1);
550 capng_apply(CAPNG_SELECT_BOTH);
551 log_info (
"Dropped all unnecessary capabilities.");
565 service_local =
"bootps";
566 service_remote =
"bootpc";
567 port_local = htons(67);
568 port_remote = htons(68);
572 service_local =
"dhcpv6-server";
573 service_remote =
"dhcpv6-client";
574 port_local = htons(547);
575 port_remote = htons(546);
580 ent = getservbyname(service_local,
"udp");
586 ent = getservbyname(service_remote,
"udp");
605 sp->
to.sin_family = AF_INET;
607 sp->
to.sin_len =
sizeof sp->
to;
616 if (upstreams == NULL || downstreams == NULL) {
617 log_info(
"Must specify at least one lower " 618 "and one upper interface.\n");
627 if (!option_code_hash_lookup(&requested_opts[0],
630 log_fatal(
"Unable to find the RELAY_MSG " 631 "option definition.");
633 if (!option_code_hash_lookup(&requested_opts[1],
636 log_fatal(
"Unable to find the INTERFACE_ID " 637 "option definition.");
642 gettimeofday(&
cur_tv, NULL);
660 if ((pid = fork()) < 0)
667 O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0644);
673 pf = fdopen(pfdesc,
"we");
678 fprintf(pf,
"%ld\n",(
long)getpid());
700 #if defined(ENABLE_GENTLE_SHUTDOWN) 707 #ifdef HAVE_LIBCAP_NG 709 if (!keep_capabilities) {
710 capng_clear(CAPNG_SELECT_BOTH);
711 capng_apply(CAPNG_SELECT_BOTH);
712 log_info (
"Dropped all capabilities.");
716 #ifdef HAVE_LIBSYSTEMD 718 sd_notifyf(0,
"READY=1\n" 719 "STATUS=Dispatching packets...\n" 721 (
unsigned long) getpid());
733 unsigned int length,
unsigned int from_port,
struct iaddr from,
736 struct sockaddr_in to;
741 log_info(
"Discarding packet with invalid hlen, received on " 742 "%s interface.", ip->
name);
746 log_info(
"Discarding packet received on %s interface that " 747 "has no IPv4 address assigned.", ip->
name);
753 if (packet->
giaddr.s_addr) {
776 to.sin_addr = packet->
yiaddr;
782 to.sin_addr.s_addr = htonl(INADDR_BROADCAST);
788 to.sin_family = AF_INET;
790 to.sin_len =
sizeof to;
802 strip_relay_agent_options(ip, &out, packet, length)))
806 log_error(
"Packet to bogus giaddr %s.\n",
807 inet_ntoa(packet->
giaddr));
816 log_debug(
"Forwarded BOOTREPLY for %s to %s",
819 inet_ntoa(to.sin_addr));
834 if (!(length = add_relay_agent_options(ip, packet, length,
843 if (!packet->
giaddr.s_addr)
856 &sp->
to, NULL) < 0) {
859 log_debug(
"Forwarded BOOTREQUEST for %s to %s",
862 inet_ntoa(sp->
to.sin_addr));
879 u_int8_t *op, *nextop, *sp, *max;
880 int good_agent_option = 0;
893 max = ((u_int8_t *)packet) + length;
928 nextop = op + op[1] + 2;
932 status = find_interface_by_agent_option(packet,
938 good_agent_option = 1;
948 nextop = op + op[1] + 2;
953 memmove(sp, op, op[1] + 2);
973 if (!good_agent_option) {
981 length = sp -((u_int8_t *)packet);
1006 find_interface_by_agent_option(
struct dhcp_packet *packet,
1008 u_int8_t *buf,
int len) {
1010 u_int8_t *circuit_id = 0;
1011 unsigned circuit_id_len = 0;
1018 i + buf[i + 1] + 2 > len) {
1025 circuit_id = &buf[i + 2];
1026 circuit_id_len = buf[i + 1];
1027 i += circuit_id_len + 2;
1031 i += buf[i + 1] + 2;
1049 !memcmp(ip->
circuit_id, circuit_id, circuit_id_len))
1071 unsigned length,
struct in_addr
giaddr) {
1072 int is_dhcp = 0, mms;
1074 u_int8_t *op, *nextop, *sp, *max, *end_pad = NULL;
1075 int adding_link_select;
1091 && (packet->
giaddr.s_addr == 0));
1094 sp = op = &packet->
options[4];
1109 if (end_pad == NULL)
1129 mms = ntohs(*(op + 2));
1132 max = ((u_int8_t *)packet) + mms;
1175 nextop = op + op[1] + 2;
1182 memmove(sp, op, op[1] + 2);
1200 if (end_pad != NULL)
1211 log_fatal(
"Circuit ID length %d out of range [1-255] on " 1217 log_fatal(
"Remote ID length %d out of range [1-255] " 1222 if (adding_link_select) {
1229 if ((optlen < 3) ||(optlen > 255))
1230 log_fatal(
"Total agent option length(%u) out of range " 1231 "[3 - 255] on %s\n", optlen, ip->
name);
1237 if (max - sp >= optlen + 3) {
1238 log_debug(
"Adding %d-byte relay agent option", optlen + 3);
1261 if (adding_link_select) {
1264 memcpy(sp, &giaddr.s_addr, 4);
1267 log_debug (
"Adding link selection suboption" 1268 " with addr: %s", inet_ntoa(giaddr));
1272 log_error(
"No room in packet (used %d of %d) " 1273 "for %d-byte relay agent option: omitted",
1274 (
int) (sp - ((u_int8_t *) packet)),
1275 (
int) (max - ((u_int8_t *) packet)),
1287 length = sp -((u_int8_t *)packet);
1302 static struct stream_list *
1303 parse_downstream(
char *arg) {
1304 struct stream_list *dp, *
up;
1306 char *ifname, *addr, *iid;
1307 isc_result_t status;
1310 (downstreams != NULL))
1311 log_fatal(
"No support for multiple interfaces.");
1314 ifname = strchr(arg,
'%');
1315 if (ifname == NULL) {
1322 iid = strchr(ifname,
'#');
1326 if (strlen(ifname) >=
sizeof(ifp->
name)) {
1327 usage(
"Interface name '%s' too long", ifname);
1331 for (dp = downstreams; dp; dp = dp->next) {
1332 if (strcmp(ifname, dp->ifp->name) == 0)
1333 log_fatal(
"Down interface '%s' declared twice.",
1338 for (up = upstreams;
up; up = up->next) {
1339 if (strcmp(ifname, up->ifp->name) == 0) {
1340 log_info(
"parse_downstream: Interface '%s' is " 1341 "both down and up.", ifname);
1349 status = interface_allocate(&ifp,
MDL);
1350 if (status != ISC_R_SUCCESS)
1352 arg, isc_result_totext(status));
1353 strcpy(ifp->
name, ifname);
1363 dp = (
struct stream_list *)
dmalloc(
sizeof(*dp),
MDL);
1373 if (addr && (inet_pton(AF_INET6, addr, &dp->link.sin6_addr) <= 0))
1374 log_fatal(
"Bad link address '%s'", addr);
1382 static struct stream_list *
1383 parse_upstream(
char *arg) {
1384 struct stream_list *
up, *dp;
1386 char *ifname, *addr;
1387 isc_result_t status;
1390 ifname = strchr(arg,
'%');
1391 if (ifname == NULL) {
1398 if (strlen(ifname) >=
sizeof(ifp->
name)) {
1399 log_fatal(
"Interface name '%s' too long", ifname);
1403 for (up = upstreams;
up; up = up->next) {
1404 if (strcmp(ifname, up->ifp->name) == 0) {
1409 for (dp = downstreams; dp; dp = dp->next) {
1410 if (strcmp(ifname, dp->ifp->name) == 0) {
1411 log_info(
"parse_upstream: Interface '%s' is " 1412 "both down and up.", ifname);
1420 status = interface_allocate(&ifp,
MDL);
1421 if (status != ISC_R_SUCCESS)
1423 arg, isc_result_totext(status));
1424 strcpy(ifp->
name, ifname);
1434 up = (
struct stream_list *)
dmalloc(
sizeof(*up),
MDL);
1440 if (inet_pton(AF_INET6, addr, &up->link.sin6_addr) <= 0)
1450 setup_streams(
void) {
1451 struct stream_list *dp, *
up;
1453 isc_boolean_t link_is_set;
1455 for (dp = downstreams; dp; dp = dp->next) {
1457 if (dp->ifp->v6address_count == 0)
1458 log_fatal(
"Interface '%s' has no IPv6 addresses.",
1462 if (IN6_IS_ADDR_UNSPECIFIED(&dp->link.sin6_addr))
1463 link_is_set = ISC_FALSE;
1465 link_is_set = ISC_TRUE;
1466 for (i = 0; i < dp->ifp->v6address_count; i++) {
1467 if (IN6_IS_ADDR_LINKLOCAL(&dp->ifp->v6addresses[i]))
1471 if (!memcmp(&dp->ifp->v6addresses[i],
1472 &dp->link.sin6_addr,
1473 sizeof(dp->link.sin6_addr)))
1476 if (i == dp->ifp->v6address_count)
1477 log_fatal(
"Interface %s does not have global IPv6 " 1478 "address assigned.", dp->ifp->name);
1480 memcpy(&dp->link.sin6_addr,
1481 &dp->ifp->v6addresses[i],
1482 sizeof(dp->link.sin6_addr));
1486 dp->id = dp->ifp->index;
1489 for (up = upstreams;
up; up = up->next) {
1491 up->link.sin6_family = AF_INET6;
1493 up->link.sin6_len =
sizeof(up->link);
1496 if (up->ifp->v6address_count == 0)
1497 log_fatal(
"Interface '%s' has no IPv6 addresses.",
1503 if (IN6_IS_ADDR_MULTICAST(&up->link.sin6_addr)) {
1512 static const int required_forw_opts[] = {
1523 process_up6(
struct packet *packet,
struct stream_list *dp) {
1524 char forw_data[65535];
1528 struct stream_list *
up;
1543 log_info(
"Relaying %s from %s port %d going up.",
1555 log_info(
"Discarding %s from %s port %d going up.",
1562 log_info(
"Unknown %d type from %s port %d going up.",
1583 if (!use_if_id && downstreams->next) {
1584 log_info(
"Shan't get back the interface.");
1600 log_fatal(
"No memory for upwards options.");
1609 }
else if (!downstreams->next) {
1610 if_id = downstreams->id;
1612 log_info(
"Don't know the interface.");
1618 NULL, (
unsigned char *) &if_id,
1629 if (dhcrelay_sub_id != NULL) {
1631 (
unsigned char *) dhcrelay_sub_id,
1632 strlen(dhcrelay_sub_id),
1643 NULL, (
unsigned char *) packet->
raw,
1653 sizeof(forw_data) - cursor,
1655 required_forw_opts, NULL);
1659 for (up = upstreams;
up; up = up->next) {
1661 (
size_t) cursor, &up->link);
1669 process_down6(
struct packet *packet) {
1670 struct stream_list *dp;
1675 struct sockaddr_in6 to;
1681 log_info(
"Discarding %s from %s port %d going down.",
1686 log_info(
"Unknown %d type from %s port %d going down.",
1694 memset(&relay_msg, 0,
sizeof(relay_msg));
1695 memset(&if_id, 0,
sizeof(if_id));
1696 memset(&to, 0,
sizeof(to));
1697 to.sin6_family = AF_INET6;
1699 to.sin6_len =
sizeof(
to);
1728 (if_id.
len !=
sizeof(
int))) {
1729 log_info(
"Can't evaluate interface-id.");
1732 memcpy(&if_index, if_id.
data,
sizeof(
int));
1733 for (dp = downstreams; dp; dp = dp->next) {
1734 if (dp->id == if_index)
1743 for (dp = downstreams; dp; dp = dp->next) {
1745 if (!memcmp(&dp->link.sin6_addr,
1747 sizeof(
struct in6_addr)))
1752 if (!dp && downstreams && !downstreams->next)
1755 log_info(
"Can't find the down interface.");
1774 log_info(
"Relaying %s to %s port %d down.",
1777 ntohs(to.sin6_port));
1790 log_info(
"Discarding %s to %s port %d down.",
1793 ntohs(to.sin6_port));
1797 log_info(
"Unknown %d type to %s port %d down.",
1800 ntohs(to.sin6_port));
1806 (
size_t) relay_msg.
len, &to);
1809 if (relay_msg.
data != NULL)
1811 if (if_id.
data != NULL)
1819 dhcpv6(
struct packet *packet) {
1820 struct stream_list *dp;
1824 process_down6(packet);
1828 for (dp = downstreams; dp; dp = dp->next) {
1831 process_up6(packet, dp);
1836 process_up6(packet, NULL);
1840 log_info(
"Can't process packet from interface '%s'.",
1867 find_class(
struct class **
class,
const char *c1,
const char *c2,
int i) {
1868 return ISC_R_NOTFOUND;
1880 return ISC_R_SUCCESS;
void do_packet6(struct interface_info *, const char *, int, int, const struct iaddr *, isc_boolean_t)
void(* dhcpv6_packet_handler)(struct interface_info *, const char *, int, int, const struct iaddr *, isc_boolean_t)
unsigned char peer_address[16]
#define DHO_DHCP_AGENT_OPTIONS
int drop_agent_mismatches
isc_boolean_t no_dhcrelay_pid
struct tree_cache * global_options[256]
struct binding_scope * global_scope
const char * piaddr(const struct iaddr addr)
void bootp(struct packet *packet)
unsigned char options[FLEXIBLE_ARRAY_MEMBER]
void(* bootp_packet_handler)(struct interface_info *, struct dhcp_packet *, unsigned, unsigned int, struct iaddr, struct hardware *)
int check_collection(struct packet *p, struct lease *l, struct collection *c)
void * dmalloc(unsigned, const char *, int)
char * print_hw_addr(int htype, const int hlen, const unsigned char *data) const
const char * dhcpv6_type_names[]
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
#define DHCPV6_RECONFIGURE
const char * path_dhcrelay_pid
isc_result_t dhcp_set_control_state(control_object_state_t oldstate, control_object_state_t newstate)
#define DHCP_CONTEXT_PRE_DB
struct in_addr * addresses
void data_string_forget(struct data_string *data, const char *file, int line)
int log_error(const char *,...) __attribute__((__format__(__printf__
#define DHCPV6_DHCPV4_QUERY
int dhcp_max_agent_option_packet_length
struct option_state * options
unsigned char dhcpv6_hop_count
unsigned char link_address[16]
unsigned char dhcpv6_msg_type
void log_fatal(const char *,...) __attribute__((__format__(__printf__
#define DHCPV6_RELAY_REPL
#define DHCPV6_LEASEQUERY
#define DHCP_CONTEXT_POST_DB
isc_boolean_t no_pid_file
struct option * requested_opts[2]
u_int16_t validate_port(char *port)
void dhcp_signal_handler(int signal)
struct server_list * next
struct interface_info * fallback_interface
int option_state_allocate(struct option_state **ptr, const char *file, int line)
isc_result_t dhcp_context_create(int flags, struct in_addr *local4, struct in6_addr *local6)
int evaluate_option_cache(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 option_cache *oc, const char *file, int line)
#define DHCPV6_DHCPV4_RESPONSE
enum @28 agent_relay_mode
#define _PATH_DHCRELAY6_PID
struct interface_info * interface
ssize_t send_packet6(struct interface_info *, const unsigned char *, size_t, struct sockaddr_in6 *)
#define D6O_SUBSCRIBER_ID
int parse_allow_deny(struct option_cache **oc, struct parse *p, int i)
ssize_t send_packet(struct interface_info *, struct packet *, struct dhcp_packet *, size_t, struct in_addr, struct sockaddr_in *, struct hardware *)
#define DHCPV6_RELAY_FORW
int save_option_buffer(struct universe *universe, struct option_state *options, struct buffer *bp, unsigned char *buffer, unsigned length, unsigned code, int terminatep)
struct interface_info * uplink
struct option_cache * lookup_option(struct universe *universe, struct option_state *options, unsigned code)
int int log_info(const char *,...) __attribute__((__format__(__printf__
int server_packets_relayed
struct interface_info * interfaces
void interface_snorf(struct interface_info *tmp, int ir)
void dhcp(struct packet *packet)
#define DHO_DHCP_MAX_MESSAGE_SIZE
#define DHCPV6_LEASEQUERY_REPLY
int store_options6(char *buf, int buflen, struct option_state *opt_state, struct packet *packet, const int *required_opts, struct data_string *oro)
int quiet_interface_discovery
int option_state_dereference(struct option_state **ptr, const char *file, int line)
void initialize_common_option_spaces()
void dhcpv6(struct packet *)
const int dhcpv6_type_name_max
struct interface_info * next
struct universe dhcpv6_universe
void classify(struct packet *p, struct class *c)
int supports_multiple_interfaces(struct interface_info *)
isc_result_t interface_setup()
u_int8_t hbuf[HARDWARE_ADDR_LEN+1]
#define INTERFACE_UPSTREAM
struct server_list * servers
void set_multicast_hop_limit(struct interface_info *info, int hop_limit)
#define INTERFACE_DOWNSTREAM
option_code_hash_t * code_hash
#define _PATH_DHCRELAY_PID
struct in6_addr dhcpv6_peer_address
int can_unicast_without_arp(struct interface_info *)
int add_rfc3527_suboption
const unsigned char * data
#define DHO_DHCP_MESSAGE_TYPE
int corrupt_agent_options
#define DHCPV6_INFORMATION_REQUEST
struct in6_addr dhcpv6_link_address
int main(int argc, char **argv)
void discover_interfaces(int state)
#define DHCP_OPTIONS_COOKIE
#define INTERFACE_REQUESTED
int client_packets_relayed
isc_result_t omapi_init(void)
unsigned char options[DHCP_MAX_OPTION_LEN]
isc_result_t find_class(struct class **class, const char *c1, const char *c2, int i)