From f8d175a7613cf707f74afc7076571d96dbedf8ce Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 16 Jul 2021 07:53:05 +0000 Subject: [PATCH] defined MIO_SKAD_IP_STRLEN --- mio/lib/mio-skad.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mio/lib/mio-skad.h b/mio/lib/mio-skad.h index 4eeb5fe..0031077 100644 --- a/mio/lib/mio-skad.h +++ b/mio/lib/mio-skad.h @@ -66,11 +66,20 @@ typedef struct mio_skad_t mio_skad_t; #define MIO_SKAD_TO_BCSTR_ADDR MIO_SKAD_TO_OOCSTR_ADDR #define MIO_SKAD_TO_BCSTR_PORT MIO_SKAD_TO_OOCSTR_PORT +#define MIO_IP4ADDR_STRLEN (15) /* not including the terminating '\0' */ +#define MIO_IP6ADDR_STRLEN (45) /* not including the terminating '\0'. pure IPv6 address, not including the scope(e.g. %10, %eth0) */ + +/* size large enough to hold the ip address plus port number. + * [IPV6ADDR%SCOPE]:PORT -> 9 for [] % : and PORT + * Let's reserve 16 for SCOPE and not include the terminting '\0' + */ +#define MIO_SKAD_IP_STRLEN (MIO_IP6ADDR_STRLEN + 25) + /* -------------------------------------------------------------------- */ -#define MIO_ETHADDR_LEN 6 -#define MIO_IP4ADDR_LEN 4 -#define MIO_IP6ADDR_LEN 16 +#define MIO_ETHADDR_LEN (6) +#define MIO_IP4ADDR_LEN (4) +#define MIO_IP6ADDR_LEN (16) #include struct MIO_PACKED mio_ethaddr_t