|
From: <jn...@us...> - 2007-05-24 22:48:45
|
Revision: 43
http://opencalea.svn.sourceforge.net/opencalea/?rev=43&view=rev
Author: jnorell
Date: 2007-05-24 15:48:43 -0700 (Thu, 24 May 2007)
Log Message:
-----------
Added function stubs for wispa functions.
Updated contact addr.
Modified Paths:
--------------
trunk/configure
trunk/configure.ac
trunk/doc/Makefile.in
trunk/doc/TODO.tap
trunk/src/opencalea.c
trunk/src/packet_processing.c
trunk/src/tap.c
trunk/src/tap.h
Modified: trunk/configure
===================================================================
--- trunk/configure 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/configure 2007-05-24 22:48:43 UTC (rev 43)
@@ -2,7 +2,7 @@
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for opencalea 0.52.
#
-# Report bugs to <mk...@me...>.
+# Report bugs to <ope...@me...>.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -730,7 +730,7 @@
PACKAGE_TARNAME='opencalea'
PACKAGE_VERSION='0.52'
PACKAGE_STRING='opencalea 0.52'
-PACKAGE_BUGREPORT='mk...@me...'
+PACKAGE_BUGREPORT='ope...@me...'
ac_unique_file="src/tap.c"
# Factoring default headers for most tests.
@@ -1512,7 +1512,7 @@
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <mk...@me...>.
+Report bugs to <ope...@me...>.
_ACEOF
ac_status=$?
fi
@@ -5080,9 +5080,9 @@
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to mk...@me... ##
-## ------------------------------- ##
+## ---------------------------------------- ##
+## Report this to ope...@me... ##
+## ---------------------------------------- ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
@@ -20208,9 +20208,9 @@
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to mk...@me... ##
-## ------------------------------- ##
+## ---------------------------------------- ##
+## Report this to ope...@me... ##
+## ---------------------------------------- ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/configure.ac 2007-05-24 22:48:43 UTC (rev 43)
@@ -2,7 +2,7 @@
AC_PREREQ(2.59)
-AC_INIT([opencalea], [0.52], [mk...@me...])
+AC_INIT([opencalea], [0.52], [ope...@me...])
AC_CONFIG_SRCDIR(src/tap.c)
AM_INIT_AUTOMAKE([1.9 foreign])
Modified: trunk/doc/Makefile.in
===================================================================
--- trunk/doc/Makefile.in 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/doc/Makefile.in 2007-05-24 22:48:43 UTC (rev 43)
@@ -165,12 +165,14 @@
top_srcdir = @top_srcdir@
opencaleadir = $(datadir)/opencalea
dist_opencalea_DATA = LICENSE \
- AUTHORS \
- TODO \
- TODO.opencalea \
- TODO.df_collector \
- TODO.lea_collector \
- TODO.tap
+ README \
+ MICRO-HOWTO \
+ AUTHORS \
+ TODO \
+ TODO.opencalea \
+ TODO.df_collector \
+ TODO.lea_collector \
+ TODO.tap
all: all-am
Modified: trunk/doc/TODO.tap
===================================================================
--- trunk/doc/TODO.tap 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/doc/TODO.tap 2007-05-24 22:48:43 UTC (rev 43)
@@ -9,3 +9,5 @@
-- change -x -y and -z requirement according to -c type
(eg. some content types won't need ContentID or IAPSystemID)
+-- use Syslog_Facility from config file
+
Modified: trunk/src/opencalea.c
===================================================================
--- trunk/src/opencalea.c 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/src/opencalea.c 2007-05-24 22:48:43 UTC (rev 43)
@@ -713,7 +713,7 @@
int i=0;
/* command line options processing */
- while (( i = getopt ( argc, argv, "f:u:g:b:p:m:n:d:D:l:L:h" )) != -1 ) {
+ while (( i = getopt ( argc, argv, "f:u:g:b:p:dD:l:L:h" )) != -1 ) {
switch ( i ) {
case 'f': // config file
@@ -842,8 +842,7 @@
controllerd_addr = strdup (value);
debug_5 ( "opencalea: Controllerd address set from config file (%s)", controllerd_addr);
} else {
- controllerd_addr = Calloc ( 64 );
- snprintf ( controllerd_addr, 64, "%s", CONTROLLERD_ADDR );
+ controllerd_addr = Strdup ( CONTROLLERD_ADDR );
debug_5 ( "opencalea: Using default Controllerd address (%s)", controllerd_addr);
}
}
@@ -853,8 +852,7 @@
controllerd_port = strdup (value);
debug_5 ( "opencalea: Controllerd listener port set from config file (%s)", controllerd_port );
} else {
- controllerd_port = Calloc ( 64 );
- snprintf ( controllerd_port, 64, "%d", CONTROLLERD_PORT );
+ controllerd_port = Strdup ( CONTROLLERD_PORT );
debug_5 ( "opencalea: Using default Controllerd listener port (%s)", controllerd_port );
}
}
Modified: trunk/src/packet_processing.c
===================================================================
--- trunk/src/packet_processing.c 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/src/packet_processing.c 2007-05-24 22:48:43 UTC (rev 43)
@@ -40,13 +40,10 @@
extern struct sockaddr_in send_df_addr;
-// tmp ... need to clean up / write all the functions below
-int content_option = 1;
-
/*
- * process_packet_cc_apdu: sends CC-APDU structures for VoP CC
+ * process_packet_ias_cc_apdu: sends CC-APDU structures for VoP CC
*/
-void process_packet_cc_apdu( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+void process_packet_ias_cc_apdu( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
struct ether_header *ethernet;
struct ip *ip;
@@ -185,9 +182,9 @@
/*
- * process_packet_cmii_pdhr: sends PacketDataHeaderReport structures for IAS CACmII
+ * process_packet_ias_cmii_pdhr: sends PacketDataHeaderReport structures for IAS CACmII
*/
-void process_packet_cmii_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+void process_packet_ias_cmii_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
struct ether_header *ethernet;
struct ip *ip;
@@ -323,10 +320,10 @@
/*
- * process_packet_cmc_pdhr: sends PacketDataHeaderReport structures for IAS CACmII,
+ * process_packet_ias_cmc_pdhr: sends PacketDataHeaderReport structures for IAS CACmII,
* and IAS-CC-APDU structures for IAS CmC
*/
-void process_packet_cmc_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+void process_packet_ias_cmc_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
struct ether_header *ethernet;
struct ip *ip;
@@ -496,11 +493,12 @@
// NOTE THIS FUNCTION ISN'T FINISHED - IT'S AN EXACT COPY OF THE OLD process_packet()
/*
- * process_packet_cmc_udp: sends PacketDataHeaderReport structures for IAS CACmII,
+ * process_packet_ias_cmc_udp: sends PacketDataHeaderReport structures for IAS CACmII,
* and UDP encapsulated IAS CmC (per IAS D.3.1)
*/
-void process_packet_cmc_udp( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+void process_packet_ias_cmc_udp( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+ const int content_option = 1;
struct ether_header *ethernet;
struct ip *ip;
struct udphdr *udp;
@@ -679,12 +677,327 @@
}
+
+/*
+ * process_packet_wispa_cmii: sends CmII in WISPA format (pcap, layer 3/4 headers)
+NOTE: CURRENTLY THIS IS JUST A COPY OF process_packet_ias_cmii_pdhr!!!!!!
+ */
+void process_packet_wispa_cmii( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+
+ struct ether_header *ethernet;
+ struct ip *ip;
+ struct udphdr *udp;
+ struct tcphdr *tcp;
+ Msg *cmii_pkt;
+ int total_pkt_length;
+ int ip_size;
+ int tcp_size;
+ int udp_size;
+ int payload_size;
+ int ip_size_total;
+ const char *payload; /* Packet Payload */
+ HEADER *dfheader;
+
+ dfheader = (HEADER *)args;
+
+#ifdef DEBUG_PKTS
+ char msg[ MAX_LOG_DEBUG_MSG_LEN ];
+ memset ( msg, '\0', MAX_LOG_DEBUG_MSG_LEN );
+#endif
+
+ dfheader->sec = header->ts.tv_sec;
+ dfheader->usec = header->ts.tv_usec/100;
+
+ /* Ethernet Packet */
+ ethernet = (struct ether_header *)(packet);
+
+ /* IP Header Offset */
+ ip = ( struct ip* )( (char *)ethernet + datalink_hdr_len );
+ ip_size_total = (int)ntohs(ip->ip_len);
+ ip_size = ip->ip_hl * 4;
+ if (ip_size < 20) {
+ log_5("Packet has invalid IP header length: %u bytes", ip_size);
+ debug_3("Packet has invalid IP header length: %u bytes", ip_size);
+ return;
+ }
+
+ dfheader->srcIP = htonl(ip->ip_src.s_addr);
+ dfheader->dstIP = htonl(ip->ip_dst.s_addr);
+
+ if (inet_ntop(AF_INET, &ip->ip_src.s_addr, dfheader->src_ip, sizeof(dfheader->src_ip)) == NULL ) {
+ pdie("inet_ntop");
+ }
+ if (inet_ntop(AF_INET, &ip->ip_dst.s_addr, dfheader->dst_ip, sizeof(dfheader->dst_ip)) == NULL ) {
+ pdie("inet_ntop");
+ }
+
+ if ( ip->ip_p == IPPROTO_UDP ) {
+ /* UDP Header */
+ udp = ( struct udphdr* ) ( (u_char *)ip + ip_size );
+
+ udp_size = sizeof(struct udphdr);
+ if (ntohs(udp->uh_ulen) <= 12) {
+ log_5("Packet has invalid UDP header length: %u bytes", udp_size);
+ debug_3("Packet has invalid UDP header length: %u bytes", udp_size);
+ return;
+ }
+
+ /* UDP Payload */
+ payload = (char *)((u_char *)udp + udp_size);
+
+ /* UDP Payload size */
+ payload_size = ntohs(udp->uh_ulen) - udp_size;
+
+#ifdef DEBUG_PKTS
+ if (payload_size > 0) {
+ debug_5("Payload (%d bytes):", payload_size);
+ print_hex(payload, payload_size);
+ }
+#endif
+
+ //format_vop_payload(dfheader);
+
+ dfheader->srcPort = ntohs(udp->uh_sport);
+ dfheader->dstPort = ntohs(udp->uh_dport);
+
+ } else if ( ip->ip_p == IPPROTO_TCP ) {
+
+ /* TCP Header */
+ tcp = ( struct tcphdr* ) ( (u_char *)ip + ip_size);
+
+ tcp_size = tcp->th_off * 4;
+ if (tcp_size < 20) {
+ log_5("Packet has invalid TCP header length: %u bytes", tcp_size);
+ debug_3("Packet has invalid TCP header length: %u bytes", tcp_size);
+ return;
+ }
+
+ /* TCP Payload */
+ payload = (char *)((u_char *)tcp + tcp_size);
+
+ /* TCP Payload size */
+ payload_size = ntohs(ip->ip_len) - (ip_size + tcp_size);
+
+ dfheader->srcPort = ntohs(tcp->th_sport);
+ dfheader->dstPort = ntohs(tcp->th_dport);
+
+ } else {
+ debug_4("Packet is neither UDP or TCP");
+ dfheader->srcPort = 0;
+ dfheader->dstPort = 0;
+ }
+
+ /*------------------------------------------------------------------------*/
+ /* WARNING: packet_data_header_report will allocate space for the BER */
+ /* encoded message. This space MUST be freed when it is no */
+ /* longer needed or a memory leak will occur. */
+ /* */
+ /* The address of the allocated memory is dfheader->encoded. */
+ /* The size of the allocated memory is dfheader->encoded_size. */
+ /* If packet_data_header_report does not return 0, no deallocation is needed. */
+ /*------------------------------------------------------------------------*/
+
+ if (packet_data_header_report(dfheader) == 0) {
+ debug_5("Packet_Data_Header_Report encoded addr: %p, size: %Zd", dfheader->encoded, dfheader->encoded_size);
+ //print_hex((const u_char *)dfheader->encoded, (size_t)dfheader->encoded_size);
+ } else {
+ return;
+ }
+
+ total_pkt_length = sizeof(Msg) + dfheader->encoded_size;
+ debug_5 ( "building T1.IAS CmII packet size: %d", total_pkt_length);
+ cmii_pkt = CmIIPacketBuild ( dfheader );
+ debug_5 ( "sending T1.IAS CmII packet size: %d", total_pkt_length );
+ //print_hex((const u_char *)cmii_pkt, (size_t)total_pkt_length);
+ PacketSend ( cmii_pkt, total_pkt_length, &send_df_socket );
+ PacketFree ( cmii_pkt );
+
+ free(dfheader->encoded);
+
+}
+
+
+/*
+ * process_packet_wispa_cmc: sends CmC in WISPA format (pcap)
+NOTE: CURRENTLY THIS IS JUST A COPY OF process_packet_ias_cmc_pdhr!!!!!!
+ */
+void process_packet_wispa_cmc( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+
+ struct ether_header *ethernet;
+ struct ip *ip;
+ struct udphdr *udp;
+ struct tcphdr *tcp;
+ Msg *cmc_pkt;
+ Msg *cmii_pkt;
+ int total_pkt_length;
+ int ip_size;
+ int tcp_size;
+ int udp_size;
+ int payload_size;
+ int ip_size_total;
+ const char *payload; /* Packet Payload */
+ HEADER *dfheader;
+
+ dfheader = (HEADER *)args;
+
+#ifdef DEBUG_PKTS
+ char msg[ MAX_LOG_DEBUG_MSG_LEN ];
+ memset ( msg, '\0', MAX_LOG_DEBUG_MSG_LEN );
+#endif
+
+ dfheader->sec = header->ts.tv_sec;
+ dfheader->usec = header->ts.tv_usec/100;
+
+ /* Ethernet Packet */
+ ethernet = (struct ether_header *)(packet);
+
+ /* IP Header Offset */
+ ip = ( struct ip* )( (char *)ethernet + datalink_hdr_len );
+ ip_size_total = (int)ntohs(ip->ip_len);
+ ip_size = ip->ip_hl * 4;
+ if (ip_size < 20) {
+ log_5("Packet has invalid IP header length: %u bytes", ip_size);
+ debug_3("Packet has invalid IP header length: %u bytes", ip_size);
+ return;
+ }
+
+ dfheader->srcIP = htonl(ip->ip_src.s_addr);
+ dfheader->dstIP = htonl(ip->ip_dst.s_addr);
+
+ if (inet_ntop(AF_INET, &ip->ip_src.s_addr, dfheader->src_ip, sizeof(dfheader->src_ip)) == NULL ) {
+ pdie("inet_ntop");
+ }
+ if (inet_ntop(AF_INET, &ip->ip_dst.s_addr, dfheader->dst_ip, sizeof(dfheader->dst_ip)) == NULL ) {
+ pdie("inet_ntop");
+ }
+
+ if ( ip->ip_p == IPPROTO_UDP ) {
+ /* UDP Header */
+ udp = ( struct udphdr* ) ( (u_char *)ip + ip_size );
+
+ udp_size = sizeof(struct udphdr);
+ if (ntohs(udp->uh_ulen) <= 12) {
+ log_5("Packet has invalid UDP header length: %u bytes", udp_size);
+ debug_3("Packet has invalid UDP header length: %u bytes", udp_size);
+ return;
+ }
+
+ /* UDP Payload */
+ payload = (char *)((u_char *)udp + udp_size);
+
+ /* UDP Payload size */
+ payload_size = ntohs(udp->uh_ulen) - udp_size;
+
+#ifdef DEBUG_PKTS
+ if (payload_size > 0) {
+ debug_5("Payload (%d bytes):", payload_size);
+ print_hex(payload, payload_size);
+ }
+#endif
+
+ //format_vop_payload(dfheader);
+
+ dfheader->srcPort = ntohs(udp->uh_sport);
+ dfheader->dstPort = ntohs(udp->uh_dport);
+
+ } else if ( ip->ip_p == IPPROTO_TCP ) {
+
+ /* TCP Header */
+ tcp = ( struct tcphdr* ) ( (u_char *)ip + ip_size);
+
+ tcp_size = tcp->th_off * 4;
+ if (tcp_size < 20) {
+ log_5("Packet has invalid TCP header length: %u bytes", tcp_size);
+ debug_3("Packet has invalid TCP header length: %u bytes", tcp_size);
+ return;
+ }
+
+ /* TCP Payload */
+ payload = (char *)((u_char *)tcp + tcp_size);
+
+ /* TCP Payload size */
+ payload_size = ntohs(ip->ip_len) - (ip_size + tcp_size);
+
+ dfheader->srcPort = ntohs(tcp->th_sport);
+ dfheader->dstPort = ntohs(tcp->th_dport);
+
+ } else {
+ debug_4("Packet is neither UDP or TCP");
+ dfheader->srcPort = 0;
+ dfheader->dstPort = 0;
+ }
+
+
+ //debug_5("IP (%d bytes):", ip_size_total);
+ //print_hex((const u_char *)ip, (size_t)ip_size_total);
+
+ dfheader->sequenceNumber++;
+ dfheader->payload = (const char *)ip;
+ dfheader->payload_size = (size_t)ip_size_total;
+ /*------------------------------------------------------------------------*/
+ /* WARNING: cc_apdu will allocate space for the BER encoded message. */
+ /* This space MUST be freed when it is no longer needed or a */
+ /* memory leak will occur. */
+ /* */
+ /* The address of the allocated memory is dfheader->encoded. */
+ /* The size of the allocated memory is dfheader->encoded_size. */
+ /* If cc_apdu does not return 0, no deallocation is needed. */
+ /*------------------------------------------------------------------------*/
+ if ( cc_apdu(dfheader) == 0) {
+ debug_5("Encoded addr(size): %p(%Zd)", dfheader->encoded_size, dfheader->encoded);
+ } else {
+ debug_5("cc_apdu returned nonzero");
+ return;
+ }
+
+ total_pkt_length = sizeof(Msg) + dfheader->encoded_size;
+ debug_5 ( "building CmC packet size: %d", total_pkt_length );
+ cmc_pkt = CmCPacketBuild ( dfheader );
+ debug_5 ( "sending CmC packet size: %d", total_pkt_length );
+ PacketSend ( cmc_pkt, total_pkt_length, &send_df_socket );
+ PacketFree ( cmc_pkt );
+
+ free(dfheader->encoded);
+
+
+ /*------------------------------------------------------------------------*/
+ /* WARNING: packet_data_header_report will allocate space for the BER */
+ /* encoded message. This space MUST be freed when it is no */
+ /* longer needed or a memory leak will occur. */
+ /* */
+ /* The address of the allocated memory is dfheader->encoded. */
+ /* The size of the allocated memory is dfheader->encoded_size. */
+ /* If packet_data_header_report does not return 0, no deallocation is needed. */
+ /*------------------------------------------------------------------------*/
+ if (packet_data_header_report(dfheader) == 0) {
+ debug_5("Packet_Data_Header_Report encoded addr: %p, size: %Zd", dfheader->encoded, dfheader->encoded_size);
+ //print_hex((const u_char *)dfheader->encoded, (size_t)dfheader->encoded_size);
+ } else {
+ return;
+ }
+
+ total_pkt_length = sizeof(Msg) + dfheader->encoded_size;
+ debug_5 ( "building T1.IAS CmII packet size: %d", total_pkt_length);
+ cmii_pkt = CmIIPacketBuild ( dfheader );
+ debug_5 ( "sending T1.IAS CmII packet size: %d", total_pkt_length );
+ //print_hex((const u_char *)cmii_pkt, (size_t)total_pkt_length);
+ PacketSend ( cmii_pkt, total_pkt_length, &send_df_socket );
+ PacketFree ( cmii_pkt );
+
+ free(dfheader->encoded);
+
+}
+
+
+
+
// NOTE THIS FUNCTION ISN'T FINISHED - IT'S AN EXACT COPY OF THE OLD process_packet()
/*
* process_packet_raw: sends content raw with no formatting
*/
void process_packet_raw( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+ const int content_option = 1;
struct ether_header *ethernet;
struct ip *ip;
struct udphdr *udp;
@@ -869,6 +1182,7 @@
*/
void process_packet_pcap( u_char *args, const struct pcap_pkthdr *header, const u_char *packet ) {
+ const int content_option = 1;
struct ether_header *ethernet;
struct ip *ip;
struct udphdr *udp;
@@ -1045,5 +1359,3 @@
free(dfheader->encoded);
}
-
-
Modified: trunk/src/tap.c
===================================================================
--- trunk/src/tap.c 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/src/tap.c 2007-05-24 22:48:43 UTC (rev 43)
@@ -35,10 +35,12 @@
#include <net/ethernet.h>
/* function declarations */
-void process_packet_cc_apdu( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
-void process_packet_cmii_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
-void process_packet_cmc_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
-void process_packet_cmc_udp( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
+void process_packet_ias_cc_apdu( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
+void process_packet_ias_cmii_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
+void process_packet_ias_cmc_pdhr( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
+void process_packet_ias_cmc_udp( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
+void process_packet_wispa_cmii( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
+void process_packet_wispa_cmc( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
void process_packet_raw( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
void process_packet_pcap( u_char *args, const struct pcap_pkthdr *header, const u_char *packet );
@@ -415,17 +417,23 @@
}
if (! strcmp(content_type, "vop-cc")) {
- debug_5("setting process_packet function to: process_packet_cc_apdu");
- process_packet_fp = &process_packet_cc_apdu;
+ debug_5("setting process_packet function to: process_packet_ias_cc_apdu");
+ process_packet_fp = &process_packet_ias_cc_apdu;
} else if (! strcmp(content_type, "ias-cmii")) {
- debug_5("setting process_packet function to: process_packet_cmii_pdhr");
- process_packet_fp = &process_packet_cmii_pdhr;
+ debug_5("setting process_packet function to: process_packet_ias_cmii_pdhr");
+ process_packet_fp = &process_packet_ias_cmii_pdhr;
} else if (! strcmp(content_type, "ias-cmc")) {
- debug_5("setting process_packet function to: process_packet_cmc_pdhr");
- process_packet_fp = &process_packet_cmc_pdhr;
+ debug_5("setting process_packet function to: process_packet_ias_cmc_pdhr");
+ process_packet_fp = &process_packet_ias_cmc_pdhr;
} else if (! strcmp(content_type, "ias-cmc-udp")) {
- debug_5("setting process_packet function to: process_packet_cmc_udp");
- process_packet_fp = &process_packet_cmc_udp;
+ debug_5("setting process_packet function to: process_packet_ias_cmc_udp");
+ process_packet_fp = &process_packet_ias_cmc_udp;
+ } else if (! strcmp(content_type, "wispa-cmii")) {
+ debug_5("setting process_packet function to: process_packet_wispa_cmii");
+ process_packet_fp = &process_packet_wispa_cmii;
+ } else if (! strcmp(content_type, "wispa-cmc")) {
+ debug_5("setting process_packet function to: process_packet_wispa_cmc");
+ process_packet_fp = &process_packet_wispa_cmc;
} else if (! strcmp(content_type, "raw")) {
debug_5("setting process_packet function to: process_packet_raw");
process_packet_fp = &process_packet_raw;
@@ -439,14 +447,13 @@
debug_4 ( "running pcap_datalink" );
switch (pcap_datalink(handle)) {
case DLT_NULL:
- datalink_hdr_len = NULL_HDRLEN;
+ datalink_hdr_len = NULL_HDR_LEN;
break;
case DLT_EN10MB:
datalink_hdr_len = ETHER_HDR_LEN;
break;
default:
- debug_1 ( "unknown datalink, using ethernet offset" );
- datalink_hdr_len = ETHER_HDR_LEN;
+ die ( "unknown datalink type (not ethernet) : %i", pcap_datalink(handle) );
break;
}
debug_4 ( "datalink_hdr_len = %d", datalink_hdr_len );
Modified: trunk/src/tap.h
===================================================================
--- trunk/src/tap.h 2007-05-22 17:06:49 UTC (rev 42)
+++ trunk/src/tap.h 2007-05-24 22:48:43 UTC (rev 43)
@@ -37,8 +37,8 @@
#define TAP_CONF_SECTION "TAP"
#endif
-#ifndef NULL_HDRLEN
-#define NULL_HDRLEN 4
+#ifndef NULL_HDR_LEN
+#define NULL_HDR_LEN 4
#endif
/* function declarations */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|