added some length enumerators in SocketAddress

This commit is contained in:
hyung-hwan 2020-09-08 08:03:39 +00:00
parent bbeec42ad2
commit b7f4bf85b6
2 changed files with 12 additions and 2 deletions

View File

@ -43,7 +43,17 @@ public:
MAX_IP4AD_STR_LEN = 15, // nnn.nnn.nnn.nnn MAX_IP4AD_STR_LEN = 15, // nnn.nnn.nnn.nnn
MAX_IP6AD_STR_LEN = 45, // XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX, XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:nnn.nnn.nnn.nnn MAX_IP6AD_STR_LEN = 45, // XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX, XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:nnn.nnn.nnn.nnn
MAX_IP4AD_PORT_STR_LEN = 21, // nnn.nnn.nnn.nnn:AAAAA MAX_IP4AD_PORT_STR_LEN = 21, // nnn.nnn.nnn.nnn:AAAAA
MAX_IP6AD_PORT_STR_LEN = 53 // [....]:AAAAA MAX_IP6AD_PORT_STR_LEN = 53,// [....]:AAAAA
MAX_LOCAL_STR_LEN = QSE_NWAD_LOCAL_MAX_PATH + 1, // when converted back, @ may be added - /tmp/xxx.sck or @xxx.sck
MAX_IPAD_STR_LEN = MAX_IP6AD_STR_LEN,
MAX_IPAD_PORT_STR_LEN = MAX_IP6AD_PORT_STR_LEN,
#if (QSE_NWAD_LOCAL_MAX_PATH > 53)
MAX_STR_LEN = MAX_LOCAL_STR_LEN
#else
MAX_STR_LEN = MAX_IP6AD_PORT_STR_LEN
#endif
}; };
SocketAddress () QSE_CPP_NOEXCEPT; SocketAddress () QSE_CPP_NOEXCEPT;

View File

@ -78,7 +78,7 @@ struct qse_nwad_t
/* note: 128 is chosen based on common path length in existing /* note: 128 is chosen based on common path length in existing
* systems. most systems have different sizes. some * systems. most systems have different sizes. some
* trailers may get truncated, when itconverted to skad. */ * trailers may get truncated, when it gets converted to skad. */
qse_char_t path[QSE_NWAD_LOCAL_MAX_PATH]; qse_char_t path[QSE_NWAD_LOCAL_MAX_PATH];
} local; } local;
} u; } u;