kade reva wrote:
The windows XP needs Cygwin installation to run the Sipp with pcap support as you need to build the exe with ossl and pcap libraries but it doesn't still build on Cygwin as it misses some IPv6 related headers. It builds fine on LINUX.

Hope this helps..


From: "Devdutt" <[EMAIL PROTECTED]>
To: <[email protected]>
Subject: [Sipp-users] Can I test RTP using the pcap feature on Windows XP ?
Date: Tue, 31 Oct 2006 13:09:45 +0530

Hi All,

I am doing some audio testing on my SIP phone.

I am using Sipp v1.1-TLS, version 20060829, built Sep  7 2006, 17:35:45.

I was able to use the -rtp_echo option and run the echo tests. I also wanted
to run some pcap audio playback based tests. Can I use the same version for
this purpose ?

I don't have the /pcap folder in my sipp installation. Also the default
embedded scenario "uac_pcap" is not available when I do a "sipp -help".
Therefore, it looks like I dont have the correct installed version with pcap
support for Windows.

What do I need in order to use/enable this feature on Win XP ?

Thanks in advance.

Regards,
Devdutt.
Lars Roland provided a patch to enable pcap play on Windows. Unfortunately, it doesn't work on my system, so I can't commit those patches. The patch is attached so that you can try yourself.

Also, here are the notes from Lars:
"I finally got some time to work on this. Patch is attached.
I don't have any IPv6 pcap files, to test with. also I did not test on any other platform than Cygwin.

The following still applies:

On my system I've copied the WinPcap developer package to "C:\cygwin\lib\WpdPack".

Additionally I had to remove or rename "pthread.h" in "C:\cygwin\lib\WpdPack\Include", as it interfered with pthread.h from cygwin. Perhaps someone who knows more about makefiles for GNU make can solve this issue in a better way.

Regards,
Lars "

--
Olivier
HP OpenCall Software
http://www.hp.com/go/opencall/

diff -bruN sipp.2006-10-12/Makefile sipp.2006-10-12-new/Makefile
--- sipp.2006-10-12/Makefile    2006-09-12 16:29:26.000000000 +0200
+++ sipp.2006-10-12-new/Makefile        2006-10-12 19:26:26.455748100 +0200
@@ -138,7 +138,7 @@
 LIBS_tru64= -lcurses -lpthread
 LIBS_freebsd= -lcurses -pthread
 LIBS_SunOS= -lcurses -lpthread -lnsl -lsocket -lstdc++ -lm -ldl -L 
/usr/local/ssl/lib/
-LIBS_Cygwin= -lcurses -lpthread -lstdc++ 
+LIBS_Cygwin= -lcurses -lpthread -lstdc++ -L /usr/lib/WpdPack/Lib
 LIBS_Darwin= -lcurses
 LIBS=$(LIBS_$(SYSTEM))
 
@@ -148,7 +148,7 @@
 INCDIR_hpux=-I. -I/usr/local/include -I/opt/openssl/include
 INCDIR_tru64=-I. -I/opt/openssl/include
 INCDIR_SunOS=-I. -I/usr/local/ssl/include/
-INCDIR_Cygwin=-I. -I/usr/include/openssl -I/usr/include
+INCDIR_Cygwin=-I. -I/usr/include/openssl -I/usr/include 
-I/usr/lib/WpdPack/Include
 INCDIR_Darwin=-I. -I/usr/local/ssl/include
 INCDIR=$(INCDIR_$(SYSTEM)) 
 
@@ -173,6 +173,12 @@
 pcapplay_ossl_hp_li_ia:
        @_HPUX_LI_FLAG=-D_HPUX_LI ; export _HPUX_LI_FLAG ; make pcapplay_ossl
 
+pcapplay_cygwin:
+       make OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m|sed 
"s/Power Macintosh/ppc/"` OBJ_PCAPPLAY="send_packets.o prepare_pcap.o" 
PCAPPLAY_LIBS="-lwpcap" PCAPPLAY="-DPCAPPLAY" $(OUTPUT)
+
+pcapplay_ossl_cygwin:
+       make OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m|sed 
"s/Power Macintosh/ppc/"` OBJ_TLS="auth.o sslinit.o sslthreadsafe.o  milenage.o 
rijndael.o" TLS_LIBS="-lssl -lcrypto" TLS="-D_USE_OPENSSL -DOPENSSL_NO_KRB5"  
OBJ_PCAPPLAY="send_packets.o prepare_pcap.o" PCAPPLAY_LIBS="-lwpcap" 
PCAPPLAY="-DPCAPPLAY" $(OUTPUT)
+
 $(OUTPUT): $(OBJ_TLS) $(OBJ_PCAPPLAY) $(OBJ)
        $(CCLINK) $(LFLAGS) $(MFLAGS) $(LIBDIR_$(SYSTEM)) \
        $(DEBUG_FLAGS) -o $@ $(OBJ_TLS) $(OBJ_PCAPPLAY) $(OBJ) $(LIBS) 
$(TLS_LIBS) $(PCAPPLAY_LIBS)
diff -bruN sipp.2006-10-12/prepare_pcap.c sipp.2006-10-12-new/prepare_pcap.c
--- sipp.2006-10-12/prepare_pcap.c      2006-08-29 10:03:34.000000000 +0200
+++ sipp.2006-10-12-new/prepare_pcap.c  2006-10-12 19:26:26.518086100 +0200
@@ -19,23 +19,37 @@
 #include <stdlib.h>
 #include <netinet/in.h>
 #include <netinet/udp.h>
-#ifdef __HPUX
+#if defined(__HPUX) || defined(__CYGWIN)
 #include <netinet/in_systm.h>
 #endif
 #include <netinet/ip.h>
+#ifndef __CYGWIN
 #include <netinet/ip6.h>
-#ifdef __HPUX
-#include <sys/socket.h>
-#include <net/if_arp.h>
-#include <netinet/if_ether.h>
-#else
-#include <net/ethernet.h>
 #endif
 #include <string.h>
 
 #include "prepare_pcap.h"
 #include "screen.hpp"
 
+/* We define our own structures for Ethernet Header and IPv6 Header as they 
are not available on CYGWIN.
+ * We only need the fields, which are necessary to determine the type of the 
next header.
+ * we could also define our own structures for UDP and IPv4. We currently use 
the structures
+ * made available by the platform, as we had no problems to get them on all 
supported platforms.
+ */
+
+typedef struct _ether_hdr {
+      char ether_dst[6];
+      char ether_src[6];
+      u_int16_t ether_type; /* we only need the type, so we can determine, if 
the next header is IPv4 or IPv6 */
+} ether_hdr;
+
+typedef struct _ipv6_hdr {
+    char dontcare[6];
+    u_int8_t nxt_header; /* we only need the next header, so we can determine, 
if the next header is UDP or not */
+    char dontcare2[33];
+} ipv6_hdr;
+
+
 #ifdef __HPUX
 int check(u_int16_t *buffer, int len){
 #else
@@ -77,9 +91,9 @@
   u_int16_t *chk_buffer;
   u_long pktlen;
   pcap_pkt *pkt_index;
-  struct ether_header *ethhdr;
+  ether_hdr *ethhdr;
   struct iphdr *iphdr;
-  struct ip6_hdr *ip6hdr;
+  ipv6_hdr *ip6hdr;
   struct udphdr *udphdr;
 
   // to be suppressed
@@ -106,9 +120,9 @@
   while ((pktdata = (u_char *) pcap_next (pcap, pkthdr)) != NULL)
   {
 #endif
-    ethhdr = (struct ether_header *)pktdata;
-    if (ntohs(ethhdr->ether_type) != ETHERTYPE_IP
-          && ntohs(ethhdr->ether_type) != 0x86dd) {
+    ethhdr = (ether_hdr *)pktdata;
+    if (ntohs(ethhdr->ether_type) != 0x0800 /* IPv4 */
+          && ntohs(ethhdr->ether_type) != 0x86dd) /* IPv6 */ {
       fprintf(stderr, "Ignoring non IP{4,6} packet!\n");
       continue;
     }
@@ -116,8 +130,8 @@
     if (iphdr && iphdr->version == 6) {
       //ipv6
       pktlen = (u_long) pkthdr->len - sizeof(*ethhdr) - sizeof(*ip6hdr);
-      ip6hdr = (struct ip6_hdr *)(void *) iphdr;
-      if (ip6hdr->ip6_nxt != IPPROTO_UDP) {
+      ip6hdr = (ipv6_hdr *)(void *) iphdr;
+      if (ip6hdr->nxt_header != IPPROTO_UDP) {
         fprintf(stderr, "prepare_pcap.c: Ignoring non UDP packet!\n");
             continue;
       }
@@ -129,7 +143,7 @@
         fprintf(stderr, "prepare_pcap.c: Ignoring non UDP packet!\n");
         continue;
       }
-#ifdef __DARWIN
+#if defined(__DARWIN) || defined(__CYGWIN)
       udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2) + 4);
 #else
       udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2));
@@ -149,7 +163,7 @@
       ERROR("Can't allocate memory for pcap pkt data");
     memcpy(pkt_index->data, udphdr, pktlen);
 
-#if defined(__HPUX) || defined(__DARWIN)
+#if defined(__HPUX) || defined(__DARWIN) || (defined __CYGWIN)
     udphdr->uh_sum = 0 ;      
 #else
     udphdr->check = 0;
@@ -158,14 +172,14 @@
       // compute a partial udp checksum
       // not including port that will be changed
       // when sending RTP
-#if defined(__HPUX) || defined(__DARWIN)
+#if defined(__HPUX) || defined(__DARWIN) || (defined __CYGWIN)
     pkt_index->partial_check = check((u_int16_t *) &udphdr->uh_ulen, pktlen - 
4) + ntohs(IPPROTO_UDP + pktlen);
 #else
     pkt_index->partial_check = check((u_int16_t *) &udphdr->len, pktlen - 4) + 
ntohs(IPPROTO_UDP + pktlen);
 #endif
     if (max_length < pktlen)
       max_length = pktlen;
-#if defined(__HPUX) || defined(__DARWIN)
+#if defined(__HPUX) || defined(__DARWIN) || (defined __CYGWIN)
     if (base > ntohs(udphdr->uh_dport))
       base = ntohs(udphdr->uh_dport);
 #else
diff -bruN sipp.2006-10-12/prepare_pcap.h sipp.2006-10-12-new/prepare_pcap.h
--- sipp.2006-10-12/prepare_pcap.h      2006-08-29 10:03:34.000000000 +0200
+++ sipp.2006-10-12-new/prepare_pcap.h  2006-10-12 19:26:26.642762100 +0200
@@ -22,7 +22,7 @@
 #include <netinet/udp.h>
 #include <time.h>
 
-#if defined(__HPUX) || defined(__DARWIN)
+#if defined(__HPUX) || defined(__DARWIN) || defined(__CYGWIN)
 #define u_int8_t uint8_t
 #define u_int16_t uint16_t
 #define u_int32_t uint32_t
diff -bruN sipp.2006-10-12/send_packets.c sipp.2006-10-12-new/send_packets.c
--- sipp.2006-10-12/send_packets.c      2006-08-29 10:03:34.000000000 +0200
+++ sipp.2006-10-12-new/send_packets.c  2006-10-12 19:26:26.705100100 +0200
@@ -45,12 +45,15 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <netinet/udp.h>
-#ifdef __DARWIN
+#if defined(__DARWIN) || defined(__CYGWIN)
 #include <netinet/in.h>
 #endif
+#ifndef __CYGWIN
 #include <netinet/ip6.h>
+#endif
 #include <errno.h>
 #include <string.h>
+#include <fcntl.h>
 
 #include "send_packets.h"
 #include "prepare_pcap.h"
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to