]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode/vlan: Remove unused macros/functions
authorJeff Lucovsky <jeff.lucovsky@corelight.com>
Sat, 27 Aug 2022 13:16:46 +0000 (09:16 -0400)
committerVictor Julien <vjulien@oisf.net>
Mon, 5 Jun 2023 09:08:21 +0000 (11:08 +0200)
This commit removes unused functions and macros related to fetching VLAN
values.

src/decode-vlan.c
src/decode-vlan.h

index b4683a1d626eae09d3e8f16a33e36e14eba2649f..2ec8e2ad9706434ce3866767981f9dace0e2552f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2021 Open Information Security Foundation
+/* Copyright (C) 2007-2022 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -95,16 +95,6 @@ int DecodeVLAN(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
     return TM_ECODE_OK;
 }
 
-uint16_t DecodeVLANGetId(const Packet *p, uint8_t layer)
-{
-    if (unlikely(layer > 2))
-        return 0;
-    if (p->vlan_idx > layer) {
-        return p->vlan_id[layer];
-    }
-    return 0;
-}
-
 typedef struct IEEE8021ahHdr_ {
     uint32_t flags;
     uint8_t c_destination[6];
index a70517c709d44badc5be3309c58f87e250395cec..809038dbe6fcf5389cdedc4db377b18b8bdadddc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2022 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -36,11 +36,6 @@ uint16_t DecodeVLANGetId(const struct Packet_ *, uint8_t layer);
 #define GET_VLAN_ID(vlanh)          ((uint16_t)(SCNtohs((vlanh)->vlan_cfi) & 0x0FFF))
 #define GET_VLAN_PROTO(vlanh)       ((SCNtohs((vlanh)->protocol)))
 
-/* return vlan id in host byte order */
-#define VLAN_GET_ID1(p)             DecodeVLANGetId((p), 0)
-#define VLAN_GET_ID2(p)             DecodeVLANGetId((p), 1)
-#define VLAN_GET_ID3(p)             DecodeVLANGetId((p), 2)
-
 /** Vlan header struct */
 typedef struct VLANHdr_ {
     uint16_t vlan_cfi;