std-aux: add NM_IFNAMSIZE

This commit is contained in:
Thomas Haller
2023-05-25 15:04:13 +02:00
parent 6b28c2867b
commit 3fd656ed37
2 changed files with 10 additions and 0 deletions

View File

@@ -1367,6 +1367,12 @@ nm_ptr_to_uintptr(const void *p)
/*****************************************************************************/
/* IFNAMSIZ is both defined in <linux/if.h> and <net/if.h>. In the past, these
* headers conflicted, so we cannot simply include either of them in a header-file.*/
#define NM_IFNAMSIZ 16
/*****************************************************************************/
#define NM_AF_UNSPEC 0 /* AF_UNSPEC */
#define NM_AF_INET 2 /* AF_INET */
#define NM_AF_INET6 10 /* AF_INET6 */

View File

@@ -7,9 +7,13 @@
#include <stdint.h>
#include <assert.h>
#include <limits.h>
#include <net/if.h>
/*****************************************************************************/
NM_STATIC_ASSERT(NM_IFNAMSIZ == IFNAMSIZ);
/*****************************************************************************/
size_t
nm_utils_get_next_realloc_size(bool true_realloc, size_t requested)
{