From 0ff403fb6014c445737b79851a1cf900069dda10 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Sat, 27 Aug 2022 09:16:46 -0400 Subject: [PATCH] decode/vlan: Remove unused macros/functions This commit removes unused functions and macros related to fetching VLAN values. --- src/decode-vlan.c | 12 +----------- src/decode-vlan.h | 7 +------ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/decode-vlan.c b/src/decode-vlan.c index b4683a1d62..2ec8e2ad97 100644 --- a/src/decode-vlan.c +++ b/src/decode-vlan.c @@ -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]; diff --git a/src/decode-vlan.h b/src/decode-vlan.h index a70517c709..809038dbe6 100644 --- a/src/decode-vlan.h +++ b/src/decode-vlan.h @@ -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;