PUD: we need to transmit IPv4/IPv6 status in the uplink
authorFerry Huberts <f.huberts@mindef.nl>
Tue, 2 Aug 2011 12:36:08 +0000 (14:36 +0200)
committerFerry Huberts <f.huberts@mindef.nl>
Tue, 18 Oct 2011 10:08:27 +0000 (12:08 +0200)
Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/src/receiver.c
lib/pud/src/wireFormat.h

index 4e300c7..2c81764 100644 (file)
@@ -237,6 +237,7 @@ static void txToAllOlsrInterfaces(TimedTxInterface interfaces) {
                                /* set TLV fields */
                                uplinkWireFormat.type = POSITION;
                                uplinkWireFormat.length = htons(aligned_size);
+                               uplinkWireFormat.ipv6 = (olsr_cnf->ip_version == AF_INET) ? 0 : 1;
                                uplinkWireFormat.pad = 0;
 
                                /* fixup validity time */
index 310fd02..0f094bb 100644 (file)
@@ -236,7 +236,8 @@ typedef enum _UplinkMessageType {
 typedef struct _UplinkWireFormat {
                uint8_t type; /**< stores a UplinkMessageType */
                uint16_t length; /**< the length of the payload in txBuffer */
-               uint8_t pad; /**< padding to align to 4 bytes */
+               uint8_t ipv6:1; /**< clear when IPv4, set when IPv6 */
+               uint8_t pad:7; /**< padding to align to 4 bytes */
                union _msg {
                        union olsr_message olsrMessage; /**< the olsr message */
                        unsigned char txBuffer[TX_BUFFER_SIZE_FOR_OLSR]; /**< payload */