]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode/ipv6: expose addr as 'struct in6_addr' as well
authorVictor Julien <victor@inliniac.net>
Wed, 4 Apr 2018 11:28:29 +0000 (13:28 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Apr 2018 11:49:13 +0000 (13:49 +0200)
src/decode.h

index 2686f7d934b44a67efba9cb1a96b62a9d0a0dca8..239704bec0be9fec83f1837a6f958b5ef77cbf83 100644 (file)
@@ -108,15 +108,17 @@ void AppLayerDecoderEventsFreeEvents(AppLayerDecoderEvents **events);
 typedef struct Address_ {
     char family;
     union {
-        uint32_t       address_un_data32[4]; /* type-specific field */
-        uint16_t       address_un_data16[8]; /* type-specific field */
-        uint8_t        address_un_data8[16]; /* type-specific field */
+        uint32_t        address_un_data32[4]; /* type-specific field */
+        uint16_t        address_un_data16[8]; /* type-specific field */
+        uint8_t         address_un_data8[16]; /* type-specific field */
+        struct in6_addr address_un_in6;
     } address;
 } Address;
 
 #define addr_data32 address.address_un_data32
 #define addr_data16 address.address_un_data16
 #define addr_data8  address.address_un_data8
+#define addr_in6addr    address.address_un_in6
 
 #define COPY_ADDRESS(a, b) do {                    \
         (b)->family = (a)->family;                 \
@@ -210,6 +212,8 @@ typedef struct Address_ {
 #define GET_IPV4_SRC_ADDR_PTR(p) ((p)->src.addr_data32)
 #define GET_IPV4_DST_ADDR_PTR(p) ((p)->dst.addr_data32)
 
+#define GET_IPV6_SRC_IN6ADDR(p) ((p)->src.addr_in6addr)
+#define GET_IPV6_DST_IN6ADDR(p) ((p)->dst.addr_in6addr)
 #define GET_IPV6_SRC_ADDR(p) ((p)->src.addr_data32)
 #define GET_IPV6_DST_ADDR(p) ((p)->dst.addr_data32)
 #define GET_TCP_SRC_PORT(p)  ((p)->sp)