Browse code

core/ip_addr: Reformat and redefine si_flags as bitshifts

Make it a bit easier to read

Alex Hermann authored on 09/06/2020 07:15:26
Showing 1 changed files
... ...
@@ -77,8 +77,14 @@ union sockaddr_union{
77 77
 };
78 78
 
79 79
 
80
-enum si_flags { SI_NONE=0, SI_IS_IP=1, SI_IS_LO=2, SI_IS_MCAST=4,
81
-	SI_IS_ANY=8, SI_IS_MHOMED=16 };
80
+enum si_flags {
81
+	SI_NONE         = 0,
82
+	SI_IS_IP        = (1<<0),
83
+	SI_IS_LO        = (1<<1),
84
+	SI_IS_MCAST     = (1<<2),
85
+	SI_IS_ANY       = (1<<3),
86
+	SI_IS_MHOMED    = (1<<4),
87
+};
82 88
 
83 89
 typedef struct addr_info {
84 90
 	str name; /* name - eg.: foo.bar or 10.0.0.1 */