#include "codecs/decode_module.h"
#include "managers/packet_manager.h"
#include "events/codec_events.h"
+#include "protocols/undefined_protocols.h"
namespace
{
else
{
p->packet_flags |= PKT_TRUST;
- p->data = esp_payload;
- p->dsize = (u_short) len - lyr_len;
- next_prot_id = -1;
+ next_prot_id = FINISHED_DECODE;
return true;
}
static void DecodeICMPEmbeddedIP6(const uint8_t *pkt, const uint32_t len, Packet *p);
-static unsigned short in_chksum_icmp6(pseudoheader6 *, unsigned short *, int);
+#if 0
+static unsigned short in_chksum_icmp6(pseudoheader6 *, unsigned short *, int);
+#endif
//--------------------------------------------------------------------
//--------------------------------------------------------------------
bool Icmp6Codec::decode(const uint8_t* raw_pkt, const uint32_t len,
- Packet* p, uint16_t &lyr_len, uint16_t &next_prot_id)
+ Packet* p, uint16_t &lyr_len, uint16_t & /* next_prot_id */)
{
if(len < icmp6::hdr_min_len())
{
p->proto_bits |= PROTO_BIT__ICMP;
p->proto_bits &= ~(PROTO_BIT__UDP | PROTO_BIT__TCP);
- next_prot_id = -1;
return true;
}
virtual void get_protocol_ids(std::vector<uint16_t>& v);
virtual bool decode(const uint8_t *raw_pkt, const uint32_t len,
- Packet *, uint16_t &lyr_len, uint16_t &next_prot_id);
+ Packet *, uint16_t &lyr_len, uint16_t &);
// DELETE
* Returns: void function
*/
bool TcpCodec::decode(const uint8_t *raw_pkt, const uint32_t len,
- Packet *p, uint16_t &lyr_len, uint16_t &next_prot_id)
+ Packet *p, uint16_t &lyr_len, uint16_t& /*next_prot_id*/)
{
if(len < tcp::hdr_len())
{
codec_events::decoder_event(p, DECODE_TCP_DGRAM_LT_TCPHDR);
p->tcph = NULL;
-// dc.discards++;
-// dc.tdisc++;
-
return false;
}
virtual void get_protocol_ids(std::vector<uint16_t>& v);
virtual bool decode(const uint8_t *raw_pkt, const uint32_t len,
- Packet *, uint16_t &lyr_len, uint16_t &next_prot_id);
+ Packet *, uint16_t &lyr_len, uint16_t &);
// DELETE from here and below
* Returns: void function
*/
bool ArpCodec::decode(const uint8_t *raw_pkt, const uint32_t len,
- Packet *p, uint16_t &lyr_len, uint16_t &next_prot_id)
+ Packet *p, uint16_t &lyr_len, uint16_t& /* next_prot_id */)
{
-// dc.arp++;
-
// if (p->greh != NULL)
// dc.gre_arp++;
if(len < sizeof(EtherARP))
{
codec_events::decoder_event(p, DECODE_ARP_TRUNCATED);
-
-// dc.discards++;
return false;
}
p->proto_bits |= PROTO_BIT__ARP;
lyr_len = sizeof(*p->ah);
- next_prot_id = -1;
-
+
return true;
}
break;
default:
- next_prot_id = -1;
break;
}
p->data = raw_pkt;
p->dsize = (uint16_t)len;
- next_prot_id = -1;
return true;
#endif /* WORDS_MUSTALIGN */
break;
default:
- next_prot_id = -1;
break;
}
return true;
virtual void get_protocol_ids(std::vector<uint16_t>& v);
virtual bool decode(const uint8_t* raw_packet, const uint32_t raw_len,
- Packet *p, uint16_t &lyr_len, uint16_t &next_prot_id);
+ Packet *p, uint16_t &lyr_len, uint16_t &);
};
} // namespace
bool SwipeCodec::decode(const uint8_t* raw_packet, const uint32_t raw_len,
- Packet *p, uint16_t &lyr_len, uint16_t &next_prot_id)
+ Packet *p, uint16_t &lyr_len, uint16_t& /*next_prot_id*/)
{
// currently unsupported
codec_events::decoder_event(p, DECODE_IP_BAD_PROTO);
PREPROC_PROFILE_START(icmpIdPerfStats);
if( (p->icmph->type == ICMP_ECHO || p->icmph->type == ICMP_ECHOREPLY)
- || (p->icmph->type == (uint16_t)ICMP6_ECHO || p->icmph->type == (uint16_t)ICMP6_REPLY)
+ || ((uint16_t)p->icmph->type == ICMP6_ECHO || (uint16_t)p->icmph->type == ICMP6_REPLY)
)
{
/* test the rule ID value against the ICMP extension ID field */
PREPROC_PROFILE_START(icmpSeqPerfStats);
if( (p->icmph->type == ICMP_ECHO || p->icmph->type == ICMP_ECHOREPLY)
- || (p->icmph->type == (uint16_t)ICMP6_ECHO || p->icmph->type == (uint16_t)ICMP6_REPLY)
+ || ((uint16_t)p->icmph->type == ICMP6_ECHO || (uint16_t)p->icmph->type == ICMP6_REPLY)
)
{
/* test the rule ID value against the ICMP extension ID field */
{
ICMPHdr* h = (ICMPHdr*)(p->layers[layer].start);
- if ( (h->type == (uint16_t)ICMP6_ECHO || h->type == (uint16_t)ICMP6_REPLY) &&
+ if ( ((uint16_t)h->type == ICMP6_ECHO || (uint16_t)h->type == ICMP6_REPLY) &&
(h->code != 0) )
{
h->code = static_cast<icmp4::IcmpCode>(0);
#define IPRAW_HDR_VER(p_rawiph) \
(ntohl(p_rawiph->ip6_vtf) >> 28)
+#if 0
+// defined in dnet.h and currently unused.
+
#ifndef IP_PROTO_HOPOPTS
# define IP_PROTO_HOPOPTS 0
#endif
#define IP_PROTO_ICMPV6 58
#define IP_PROTO_IPV6 41
#define IP_PROTO_IPIP 4
+#endif
#define IP6F_OFFSET_MASK 0xfff8 /* mask out offset from _offlg */
#define IP6F_MF_MASK 0x0001 /* more-fragments flag */