Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
mapi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arne Øslebø
mapi
Commits
7d223639
Commit
7d223639
authored
Mar 20, 2008
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added basic support for POS protocol.
git-svn-id:
file:///home/svn/mapi/trunk@1394
8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent
bcf18b6c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
441 additions
and
181 deletions
+441
-181
src/trackflib/dc.c
src/trackflib/dc.c
+42
-19
src/trackflib/edonkey.c
src/trackflib/edonkey.c
+44
-17
src/trackflib/gnutella.c
src/trackflib/gnutella.c
+42
-20
src/trackflib/gridftp.c
src/trackflib/gridftp.c
+43
-20
src/trackflib/irc.c
src/trackflib/irc.c
+42
-19
src/trackflib/skype.c
src/trackflib/skype.c
+44
-20
src/trackflib/torrent.c
src/trackflib/torrent.c
+96
-24
src/trackflib/trackftp.c
src/trackflib/trackftp.c
+43
-20
src/trackflib/web.c
src/trackflib/web.c
+45
-22
No files found.
src/trackflib/dc.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -17,8 +18,7 @@
#include "acsmx2.h"
#include "mapi_errors.h"
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -35,7 +35,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
...
...
@@ -192,6 +191,10 @@ static int dc_process(mapidflib_function_instance_t *instance,
struct
list
**
dclist
=
((
struct
mapid_dc
*
)
instance
->
internal_data
)
->
dclist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
struct
udphdr
*
udph
=
NULL
;
...
...
@@ -211,8 +214,11 @@ static int dc_process(mapidflib_function_instance_t *instance,
if
(
pkt_color
!=
0
&&
pkt_color
!=
DC_COLOR
)
{
return
0
;
}
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -234,6 +240,23 @@ static int dc_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/edonkey.c
View file @
7d223639
...
...
@@ -7,6 +7,7 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -15,6 +16,8 @@
#include "debug.h"
#include "mapiipc.h"
#include "mstring.h"
#include <pcap.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -277,6 +280,10 @@ static int edonkey_process(mapidflib_function_instance_t *instance,
struct
list
**
edonkeylist
=
((
struct
mapid_edonkey
*
)
instance
->
internal_data
)
->
edonkeylist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
struct
udphdr
*
udph
=
NULL
;
...
...
@@ -303,6 +310,8 @@ static int edonkey_process(mapidflib_function_instance_t *instance,
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
ether_len
=
sizeof
(
struct
ether_header
);
...
...
@@ -325,6 +334,24 @@ static int edonkey_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
ether_len
=
sizeof
(
struct
pos_header
);
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/gnutella.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -17,8 +18,7 @@
#include "acsmx2.h"
#include "mapi_errors.h"
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -35,7 +35,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
...
...
@@ -177,6 +176,10 @@ static int gnutella_process(mapidflib_function_instance_t *instance,
struct
list
**
gnulist
=
((
struct
mapid_gnutella
*
)
instance
->
internal_data
)
->
gnulist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
struct
udphdr
*
udph
=
NULL
;
...
...
@@ -199,6 +202,8 @@ static int gnutella_process(mapidflib_function_instance_t *instance,
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -220,6 +225,23 @@ static int gnutella_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/gridftp.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -14,8 +15,8 @@
#include "debug.h"
#include "mapiipc.h"
#include "mstring.h"
#include <stdio.h>
#include <
stdlib
.h>
#include <
pcap
.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -32,7 +33,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
...
...
@@ -101,6 +101,10 @@ static int gridftp_process(mapidflib_function_instance_t *instance,
struct
list
**
cntlist
=
((
struct
mapid_ftp
*
)
instance
->
internal_data
)
->
cntlist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
...
...
@@ -119,6 +123,8 @@ static int gridftp_process(mapidflib_function_instance_t *instance,
}
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -140,6 +146,23 @@ static int gridftp_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/irc.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -14,8 +15,8 @@
#include "debug.h"
#include "mapiipc.h"
#include "mstring.h"
#include <stdio.h>
#include <
stdlib
.h>
#include <
pcap
.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -32,7 +33,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
...
...
@@ -132,6 +132,10 @@ static int irc_process(mapidflib_function_instance_t *instance,
struct
list
**
irclist
=
((
struct
mapid_irc
*
)
instance
->
internal_data
)
->
irclist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
struct
udphdr
*
udph
=
NULL
;
...
...
@@ -148,6 +152,8 @@ static int irc_process(mapidflib_function_instance_t *instance,
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -169,6 +175,23 @@ static int irc_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/skype.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -14,8 +15,8 @@
#include "debug.h"
#include "mapiipc.h"
#include "mstring.h"
#include <stdio.h>
#include <
stdlib
.h>
#include <
pcap
.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -32,7 +33,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
...
...
@@ -272,6 +272,10 @@ static int trackskype_process(mapidflib_function_instance_t *instance,
struct
list
**
cntlist
=
((
struct
mapid_skype
*
)
instance
->
internal_data
)
->
cntlist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
struct
udphdr
*
udph
=
NULL
;
...
...
@@ -293,8 +297,11 @@ static int trackskype_process(mapidflib_function_instance_t *instance,
if
(
pkt_color
!=
0
&&
pkt_color
!=
SKYPE_COLOR
)
{
return
0
;
}
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -316,6 +323,23 @@ static int trackskype_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/torrent.c
View file @
7d223639
...
...
@@ -18,8 +18,7 @@
#include "acsmx2.h"
#include "mapi_errors.h"
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -36,7 +35,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
...
...
@@ -220,6 +218,10 @@ static int torrent_process(mapidflib_function_instance_t *instance,
struct
list
**
torlist
=
((
struct
mapid_torrent
*
)
instance
->
internal_data
)
->
torlist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
struct
udphdr
*
udph
=
NULL
;
...
...
@@ -235,7 +237,7 @@ static int torrent_process(mapidflib_function_instance_t *instance,
int
i
=
0
;
int
ether_len
=
0
,
ip_len
=
0
,
tcp_len
=
0
,
udp_len
=
0
;
int
ip_len
=
0
,
tcp_len
=
0
,
udp_len
=
0
;
int
pkt_color
=
pkt_head
->
color
;
...
...
@@ -244,11 +246,64 @@ static int torrent_process(mapidflib_function_instance_t *instance,
}
p
=
pkt
;
/*
typedef struct flags {
uint8_t iface:2;
uint8_t vlen:1;
uint8_t trunc:1;
uint8_t rxerror:1;
uint8_t dserror:1;
uint8_t reserved:1;
uint8_t direction:1;
} flags_t;
typedef struct dag_record {
uint64_t ts;
uint8_t type;
flags_t flags;
uint16_t rlen;
uint16_t lctr;
uint16_t wlen;
union {
pos_rec_t pos;
eth_rec_t eth;
atm_rec_t atm;
aal5_rec_t aal5;
aal2_rec_t aal2;
mc_hdlc_rec_t mc_hdlc;
mc_raw_rec_t mc_raw;
mc_atm_rec_t mc_atm;
mc_aal_rec_t mc_aal5;
mc_aal_rec_t mc_aal2;
mc_raw_channel_rec_t mc_raw_channel;
} rec;
} dag_record_t;
typedef struct pos_rec {
uint32_t hdlc;
uint8_t pload[1];
} pos_rec_t;
typedef struct eth_rec {
uint8_t offset;
uint8_t pad;
uint8_t dst[6];
uint8_t src[6];
uint16_t etype;
uint8_t pload[1];
} eth_rec_t;
typedef struct mc_hdlc_rec {
uint32_t mc_header;
uint8_t pload[1];
} mc_hdlc_rec_t;
*/
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
ether_len
=
sizeof
(
struct
ether_header
);
// skip ethernet header
p
+=
sizeof
(
struct
ether_header
);
...
...
@@ -268,6 +323,23 @@ static int torrent_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/trackftp.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -14,8 +15,8 @@
#include "debug.h"
#include "mapiipc.h"
#include "mstring.h"
#include <stdio.h>
#include <
stdlib
.h>
#include <
pcap
.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -32,7 +33,6 @@
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <time.h>
...
...
@@ -101,6 +101,10 @@ static int trackftp_process(mapidflib_function_instance_t *instance,
struct
list
**
cntlist
=
((
struct
mapid_ftp
*
)
instance
->
internal_data
)
->
cntlist
;
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
...
...
@@ -119,6 +123,8 @@ static int trackftp_process(mapidflib_function_instance_t *instance,
}
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -140,6 +146,23 @@ static int trackftp_process(mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);
len
-=
sizeof
(
struct
pos_header
);
ethertype
=
ntohs
(
pp
->
cf
);
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
default:
//DEBUG_CMD(Debug_Message("Link layer not supported"));
return
0
;
}
// IP header struct over the packet data;
iph
=
(
struct
iphdr
*
)
p
;
...
...
src/trackflib/web.c
View file @
7d223639
...
...
@@ -6,6 +6,7 @@
#include <sys/shm.h>
#include <string.h>
#include <errno.h>
#include "mapidflib.h"
#include "mapidlib.h"
#include "mapidevices.h"
...
...
@@ -17,8 +18,7 @@
#include "acsmx2.h"
#include "mapi_errors.h"
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
...
...
@@ -53,6 +53,10 @@ static int web_process(MAPI_UNUSED mapidflib_function_instance_t *instance,
uint16_t
ethertype
;
struct
ether_header
*
ep
=
NULL
;
struct
pos_header
{
uint16_t
af
;
uint16_t
cf
;
}
*
pp
=
NULL
;
struct
iphdr
*
iph
=
NULL
;
struct
tcphdr
*
tcph
=
NULL
;
...
...
@@ -71,6 +75,8 @@ static int web_process(MAPI_UNUSED mapidflib_function_instance_t *instance,
p
=
pkt
;
switch
(
instance
->
hwinfo
->
link_type
)
{
case
DLT_EN10MB
:
// lay the Ethernet header struct over the packet data
ep
=
(
struct
ether_header
*
)
p
;
...
...
@@ -92,6 +98,23 @@ static int web_process(MAPI_UNUSED mapidflib_function_instance_t *instance,
else
if
(
ethertype
!=
ETHERTYPE_IP
)
{
return
0
;
}
break
;
case
DLT_CHDLC
:
pp
=
(
struct
pos_header
*
)
p
;
p
+=
sizeof
(
struct
pos_header
);