From b2aa704dab80d1683e34346ce2354b74dd306aff Mon Sep 17 00:00:00 2001 From: Alex Hermann Date: Tue, 9 Jun 2020 09:15:26 +0200 Subject: [PATCH] core/ip_addr: Reformat and redefine si_flags as bitshifts Make it a bit easier to read --- src/core/ip_addr.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/ip_addr.h b/src/core/ip_addr.h index 2b67c214ec2..b366586ca95 100644 --- a/src/core/ip_addr.h +++ b/src/core/ip_addr.h @@ -77,8 +77,14 @@ union sockaddr_union{ }; -enum si_flags { SI_NONE=0, SI_IS_IP=1, SI_IS_LO=2, SI_IS_MCAST=4, - SI_IS_ANY=8, SI_IS_MHOMED=16 }; +enum si_flags { + SI_NONE = 0, + SI_IS_IP = (1<<0), + SI_IS_LO = (1<<1), + SI_IS_MCAST = (1<<2), + SI_IS_ANY = (1<<3), + SI_IS_MHOMED = (1<<4), +}; typedef struct addr_info { str name; /* name - eg.: foo.bar or 10.0.0.1 */