Commit 5b10b851 authored by 's avatar
Browse files

anonymization support for POS packets.


git-svn-id: file:///home/svn/mapi/trunk@820 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 7eb78514
......@@ -9,6 +9,7 @@
void DecodeTRPkt(mapipacket *, struct pcap_pkthdr *, unsigned char *,int snaplen);
void DecodeFDDIPkt(mapipacket *, struct pcap_pkthdr *, unsigned char *,int snaplen);
void DecodeLinuxSLLPkt(mapipacket *, struct pcap_pkthdr *, unsigned char *,int snaplen);
void DecodePOSPkt(mapipacket *, struct pcap_pkthdr *, unsigned char *, int snaplen);
void DecodeEthPkt(mapipacket *, struct pcap_pkthdr *, unsigned char *,int snaplen);
void DecodeIEEE80211Pkt(mapipacket *, struct pcap_pkthdr *, unsigned char *,int snaplen);
void DecodeVlan(unsigned char *, const unsigned int, mapipacket *,int snaplen);
......@@ -37,6 +38,25 @@ int DecodeIPOnly(unsigned char * pkt, const unsigned int len, mapipacket * p,int
grinder_t SetPktProcessor(int datalink);
void DecodePOSPkt(mapipacket * p, struct pcap_pkthdr * pkthdr, unsigned char * pkt, int snaplen)
{
unsigned int pkt_len; /* suprisingly, the length of the packet */
unsigned int cap_len; /* caplen value */
bzero((char *) p, sizeof(mapipacket));
p->pkth = pkthdr;
p->pkt = pkt;
/* set the lengths we need */
pkt_len = pkthdr->len; /* total packet length */
cap_len = pkthdr->caplen; /* captured packet length */
if(snaplen < (int)pkt_len)
pkt_len = cap_len;
DecodeIP(p->pkt + 4, cap_len - 4, p, snaplen);
}
void DecodeEthPkt(mapipacket * p, struct pcap_pkthdr * pkthdr, unsigned char * pkt,int snaplen)
{
......@@ -1830,7 +1850,9 @@ grinder_t SetPktProcessor(int datalink)
case DLT_EN10MB: /* Ethernet */
grinder = DecodeEthPkt;
break;
case DLT_CHDLC: /* POS */
grinder = DecodePOSPkt;
break;
#ifdef DLT_IEEE802_11
case DLT_IEEE802_11:
grinder = DecodeIEEE80211Pkt;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment