-/* $OpenBSD: dhcp6leased.h,v 1.8 2024/06/06 15:15:44 florian Exp $ */
+/* $OpenBSD: dhcp6leased.h,v 1.9 2024/07/10 12:44:46 florian Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
const char *sin6_to_str(struct sockaddr_in6 *);
/* engine.c */
-const char *dhcp_message_type2str(uint8_t);
+const char *dhcp_message_type2str(int);
/* frontend.c */
struct iface_conf *find_iface_conf(struct iface_conf_head *, char *);
-/* $OpenBSD: engine.c,v 1.18 2024/07/10 10:30:46 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.19 2024/07/10 12:44:46 florian Exp $ */
/*
* Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
void send_reconfigure_interface(struct iface_pd_conf *,
struct prefix *, enum reconfigure_action);
int engine_imsg_compose_main(int, pid_t, void *, uint16_t);
-const char *dhcp_message_type2str(uint8_t);
-const char *dhcp_option_type2str(uint16_t);
+const char *dhcp_option_type2str(int);
const char *dhcp_duid2str(int, uint8_t *);
-const char *dhcp_status2str(uint8_t);
+const char *dhcp_status2str(int);
void in6_prefixlen2mask(struct in6_addr *, int len);
struct dhcp6leased_conf *engine_conf;
}
const char *
-dhcp_message_type2str(uint8_t type)
+dhcp_message_type2str(int type)
{
static char buf[sizeof("Unknown [255]")];
case DHCPRELAYREPL:
return "DHCPRELAYREPL";
default:
- snprintf(buf, sizeof(buf), "Unknown [%u]", type);
+ snprintf(buf, sizeof(buf), "Unknown [%u]", type & 0xff);
return buf;
}
}
const char *
-dhcp_option_type2str(uint16_t code)
+dhcp_option_type2str(int code)
{
static char buf[sizeof("Unknown [65535]")];
switch (code) {
case DHO_INF_MAX_RT:
return "DHO_INF_MAX_RT";
default:
- snprintf(buf, sizeof(buf), "Unknown [%u]", code);
+ snprintf(buf, sizeof(buf), "Unknown [%u]", code &0xffff);
return buf;
}
}
}
const char*
-dhcp_status2str(uint8_t status)
+dhcp_status2str(int status)
{
static char buf[sizeof("Unknown [255]")];
case DHCP_STATUS_NOPREFIXAVAIL:
return "NoPrefixAvail";
default:
- snprintf(buf, sizeof(buf), "Unknown [%u]", status);
+ snprintf(buf, sizeof(buf), "Unknown [%u]", status & 0xff);
return buf;
}
}