lq_packet: make the hello link order a define
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 30 Jan 2017 16:24:07 +0000 (17:24 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 7 Feb 2017 12:37:43 +0000 (13:37 +0100)
This will be re-used later

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/lq_packet.c
src/olsr_protocol.h

index 287f4b4..5364f8b 100644 (file)
@@ -326,7 +326,7 @@ serialize_common(struct olsr_common *comm)
 static void
 serialize_lq_hello(struct lq_hello_message *lq_hello, struct interface_olsr *outif)
 {
-  static const int LINK_ORDER[] = { UNSPEC_LINK, LOST_LINK, ASYM_LINK, SYM_LINK };
+  static const int LINK_ORDER[] = HELLO_LINK_ORDER_ARRAY;
   int rem, size, req, expected_size = 0;
   struct lq_hello_info_header *info_head;
   struct lq_hello_neighbor *neigh;
index a995db0..90e4db3 100644 (file)
@@ -111,6 +111,8 @@ struct olsr;
 #define HIDE_LINK             4
 #define MAX_LINK              4
 
+#define HELLO_LINK_ORDER_ARRAY { UNSPEC_LINK, LOST_LINK, ASYM_LINK, SYM_LINK }
+
 static INLINE const char * linkTypeToString(int type) {
   switch (type) {
     case ASYM_LINK: