diff -cr sipp.2006-08-21/Makefile sipp.2006-08-21.darwin/Makefile
*** sipp.2006-08-21/Makefile	Mon Aug 21 14:54:58 2006
--- sipp.2006-08-21.darwin/Makefile	Mon Aug 28 13:46:29 2006
***************
*** 32,37 ****
--- 32,38 ----
  LIBDIR_tru64=
  LIBDIR_SunOS=
  LIBDIR_Cygwin=
+ LIBDIR_Darwin=
  
  # Archive file created in your home directory when building the archive target
  # ARCHIVE= $(HOME)/$(OUTPUT).tgz
***************
*** 55,60 ****
--- 56,62 ----
  SYSTEM_OSF1=tru64
  SYSTEM_SunOS=SunOS
  SYSTEM_CYGWIN=Cygwin
+ SYSTEM_Darwin=Darwin
  SYSTEM=$(SYSTEM_$(OSNAME))
  
  # C compiler
***************
*** 64,69 ****
--- 66,72 ----
  CC_tru64=cc  
  CC_SunOS=gcc
  CC_Cygwin=cc  
+ CC_Darwin=cc  
  CC=$(CC_$(SYSTEM))
  
  # C++ compiler mapping
***************
*** 73,78 ****
--- 76,82 ----
  CPP_tru64=cxx  
  CPP_SunOS=g++
  CPP_Cygwin=g++  
+ CPP_Darwin=g++  
  CPP=$(CPP_$(SYSTEM))
  
  #Model specific flags
***************
*** 94,99 ****
--- 98,104 ----
  CFLAGS_tru64=-D__OSF1 -pthread
  CFLAGS_SunOS=-g
  CFLAGS_Cygwin=-D__CYGWIN -Dsocklen_t=int
+ CFLAGS_Darwin=-D__DARWIN
  CFLAGS=$(CFLAGS_$(SYSTEM)) -D__3PCC__ $(TLS) $(PCAPPLAY)
  
  #C++ Compiler Flags
***************
*** 103,108 ****
--- 108,114 ----
  CPPFLAGS_tru64=-D__OSF1 -pthread
  CPPFLAGS_SunOS=-g
  CPPFLAGS_Cygwin=-D__CYGWIN -Dsocklen_t=int
+ CPPFLAGS_Darwin=-D__DARWIN
  CPPFLAGS=$(CPPFLAGS_$(SYSTEM)) -D__3PCC__ $(TLS) $(PCAPPLAY)
  
  #Linker mapping
***************
*** 112,117 ****
--- 118,124 ----
  CCLINK_tru64=cxx
  CCLINK_SunOS=gcc
  CCLINK_Cygwin=g++
+ CCLINK_Darwin=g++
  CCLINK=$(CCLINK_$(SYSTEM))
  
  #Linker Flags
***************
*** 121,126 ****
--- 128,134 ----
  LFLAGS_tru64=
  LFLAGS_SunOS=
  LFLAGS_Cygwin=
+ LFLAGS_Darwin=
  LFLAGS=$(LFLAGS_$(SYSTEM))
  
  #Link Libraries
***************
*** 130,135 ****
--- 138,144 ----
  LIBS_freebsd= -lcurses -pthread
  LIBS_SunOS= -lcurses -lpthread -lnsl -lsocket -lstdc++ -lm -ldl -L /usr/local/ssl/lib/
  LIBS_Cygwin= -lcurses -lpthread -lstdc++ 
+ LIBS_Darwin= -lcurses
  LIBS=$(LIBS_$(SYSTEM))
  
  # Include directories
***************
*** 139,144 ****
--- 148,154 ----
  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_Darwin=-I. -I/usr/local/ssl/include
  INCDIR=$(INCDIR_$(SYSTEM)) 
  
  # Building without TLS and authentication (no openssl pre-requisite)
diff -cr sipp.2006-08-21/prepare_pcap.c sipp.2006-08-21.darwin/prepare_pcap.c
*** sipp.2006-08-21/prepare_pcap.c	Fri Jul  7 07:49:18 2006
--- sipp.2006-08-21.darwin/prepare_pcap.c	Mon Aug 28 15:12:25 2006
***************
*** 129,135 ****
--- 129,139 ----
          fprintf(stderr, "prepare_pcap.c: Ignoring non UDP packet!\n");
          continue;
        }
+ #ifdef __DARWIN
+       udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2) + 4);
+ #else
        udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2));
+ #endif
      }
      if (pktlen > PCAP_MAXPACKET) {
        ERROR("Packet size is too big! Recompile with bigger PCAP_MAXPACKET in prepare_pcap.h");
***************
*** 145,151 ****
        ERROR("Can't allocate memory for pcap pkt data");
      memcpy(pkt_index->data, udphdr, pktlen);
  
! #ifdef __HPUX
      udphdr->uh_sum = 0 ;      
  #else
      udphdr->check = 0;
--- 149,155 ----
        ERROR("Can't allocate memory for pcap pkt data");
      memcpy(pkt_index->data, udphdr, pktlen);
  
! #if defined(__HPUX) || defined(__DARWIN)
      udphdr->uh_sum = 0 ;      
  #else
      udphdr->check = 0;
***************
*** 154,167 ****
        // compute a partial udp checksum
        // not including port that will be changed
        // when sending RTP
! #ifdef __HPUX
      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;
! #ifdef __HPUX
      if (base > ntohs(udphdr->uh_dport))
        base = ntohs(udphdr->uh_dport);
  #else
--- 158,171 ----
        // compute a partial udp checksum
        // not including port that will be changed
        // when sending RTP
! #if defined(__HPUX) || defined(__DARWIN)
      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 (base > ntohs(udphdr->uh_dport))
        base = ntohs(udphdr->uh_dport);
  #else
diff -cr sipp.2006-08-21/prepare_pcap.h sipp.2006-08-21.darwin/prepare_pcap.h
*** sipp.2006-08-21/prepare_pcap.h	Fri Jul  7 07:49:18 2006
--- sipp.2006-08-21.darwin/prepare_pcap.h	Mon Aug 28 14:14:11 2006
***************
*** 22,28 ****
  #include <netinet/udp.h>
  #include <time.h>
  
! #ifdef __HPUX
  #define u_int8_t uint8_t
  #define u_int16_t uint16_t
  #define u_int32_t uint32_t
--- 22,28 ----
  #include <netinet/udp.h>
  #include <time.h>
  
! #if defined(__HPUX) || defined(__DARWIN)
  #define u_int8_t uint8_t
  #define u_int16_t uint16_t
  #define u_int32_t uint32_t
diff -cr sipp.2006-08-21/send_packets.c sipp.2006-08-21.darwin/send_packets.c
*** sipp.2006-08-21/send_packets.c	Fri Jul  7 07:49:18 2006
--- sipp.2006-08-21.darwin/send_packets.c	Mon Aug 28 15:16:04 2006
***************
*** 45,50 ****
--- 45,53 ----
  #include <unistd.h>
  #include <stdlib.h>
  #include <netinet/udp.h>
+ #ifdef __DARWIN
+ #include <netinet/in.h>
+ #endif
  #include <netinet/ip6.h>
  #include <errno.h>
  #include <string.h>
