summaryrefslogtreecommitdiffstats
path: root/main/sipp/musl-fixes.patch
blob: 378b50fcc64d4eb9c5bedf061622d6c6f162f10b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
diff --git a/auth.c b/auth.c
index 544e1a9..e1551ff 100644
--- a/auth.c
+++ b/auth.c
@@ -42,24 +42,24 @@ extern char               *auth_uri;
 /* AKA */
 
 #define KLEN 16
-typedef u_char K[KLEN];
+typedef unsigned char K[KLEN];
 #define RANDLEN 16
-typedef u_char RAND[RANDLEN];
+typedef unsigned char RAND[RANDLEN];
 #define AUTNLEN 16
-typedef u_char AUTN[AUTNLEN];
+typedef unsigned char AUTN[AUTNLEN];
 
 #define AKLEN 6
-typedef u_char AK[AKLEN];
+typedef unsigned char AK[AKLEN];
 #define AMFLEN 2
-typedef u_char AMF[AMFLEN];
+typedef unsigned char AMF[AMFLEN];
 #define MACLEN 8
-typedef u_char MAC[MACLEN];
+typedef unsigned char MAC[MACLEN];
 #define CKLEN 16
-typedef u_char CK[CKLEN];
+typedef unsigned char CK[CKLEN];
 #define IKLEN 16
-typedef u_char IK[IKLEN];
+typedef unsigned char IK[IKLEN];
 #define SQNLEN 6
-typedef u_char SQN[SQNLEN];
+typedef unsigned char SQN[SQNLEN];
 #define AUTSLEN 14
 typedef char AUTS[AUTSLEN];
 #define AUTS64LEN 29
@@ -69,7 +69,7 @@ typedef unsigned char RES[RESLEN+1];
 #define RESHEXLEN 17
 typedef char RESHEX[RESHEXLEN];
 #define OPLEN 16
-typedef u_char OP[OPLEN];
+typedef unsigned char OP[OPLEN];
 
 AMF amfstar="\0\0";
 SQN sqn_he={0x00,0x00,0x00,0x00,0x00,0x00};
diff --git a/prepare_pcap.c b/prepare_pcap.c
index 07ccb26..d6dd102 100644
--- a/prepare_pcap.c
+++ b/prepare_pcap.c
@@ -15,6 +15,7 @@
  *
  *  Author : Guillaume TEISSIER from FTR&D 02/02/2006
  */
+#define _GNU_SOURCE
 #include <pcap.h>
 #include <stdlib.h>
 #include <netinet/in.h>
@@ -84,11 +85,11 @@ char errbuf[PCAP_ERRBUF_SIZE];
 int prepare_pkts(char *file, pcap_pkts *pkts) {
   pcap_t *pcap;
   struct pcap_pkthdr *pkthdr = NULL;
-  u_char *pktdata = NULL;
+  unsigned char *pktdata = NULL;
   int n_pkts = 0;
-  u_long max_length = 0;
+  unsigned long max_length = 0;
   u_int16_t base = 0xffff;
-  u_long pktlen;
+  unsigned long pktlen;
   pcap_pkt *pkt_index;
   ether_hdr *ethhdr;
   struct iphdr *iphdr;
@@ -102,7 +103,7 @@ int prepare_pkts(char *file, pcap_pkts *pkts) {
     ERROR("Can't open PCAP file '%s'", file);
 
 #if HAVE_PCAP_NEXT_EX
-  while (pcap_next_ex (pcap, &pkthdr, (const u_char **) &pktdata) == 1)
+  while (pcap_next_ex (pcap, &pkthdr, (const unsigned char **) &pktdata) == 1)
   {
 #else
 #ifdef __HPUX
@@ -112,7 +113,7 @@ int prepare_pkts(char *file, pcap_pkts *pkts) {
 #endif
   if (!pkthdr)
     ERROR("Can't allocate memory for pcap pkthdr");
-  while ((pktdata = (u_char *) pcap_next (pcap, pkthdr)) != NULL)
+  while ((pktdata = (unsigned char *) pcap_next (pcap, pkthdr)) != NULL)
   {
 #endif
     ethhdr = (ether_hdr *)pktdata;
@@ -124,7 +125,7 @@ int prepare_pkts(char *file, pcap_pkts *pkts) {
     iphdr = (struct iphdr *)((char *)ethhdr + sizeof(*ethhdr));
     if (iphdr && iphdr->version == 6) {
       //ipv6
-      pktlen = (u_long) pkthdr->len - sizeof(*ethhdr) - sizeof(*ip6hdr);
+      pktlen = (unsigned long) pkthdr->len - sizeof(*ethhdr) - sizeof(*ip6hdr);
       ip6hdr = (ipv6_hdr *)(void *) iphdr;
       if (ip6hdr->nxt_header != IPPROTO_UDP) {
         fprintf(stderr, "prepare_pcap.c: Ignoring non UDP packet!\n");
@@ -139,13 +140,13 @@ int prepare_pkts(char *file, pcap_pkts *pkts) {
       }
 #if defined(__DARWIN) || defined(__CYGWIN) || defined(__FreeBSD__)
       udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2) + 4);
-      pktlen = (u_long)(ntohs(udphdr->uh_ulen));
+      pktlen = (unsigned long)(ntohs(udphdr->uh_ulen));
 #elif defined ( __HPUX)
       udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2));
-      pktlen = (u_long) pkthdr->len - sizeof(*ethhdr) - sizeof(*iphdr);
+      pktlen = (unsigned long) pkthdr->len - sizeof(*ethhdr) - sizeof(*iphdr);
 #else
       udphdr = (struct udphdr *)((char *)iphdr + (iphdr->ihl << 2));
-      pktlen = (u_long)(ntohs(udphdr->len));
+      pktlen = (unsigned long)(ntohs(udphdr->len));
 #endif
     }
     if (pktlen > PCAP_MAXPACKET) {
diff --git a/prepare_pcap.h b/prepare_pcap.h
index ae90556..e89ab52 100644
--- a/prepare_pcap.h
+++ b/prepare_pcap.h
@@ -52,8 +52,8 @@ struct iphdr
 
 typedef struct
 {
-  u_char *data;
-  u_long pktlen;
+  unsigned char *data;
+  unsigned long pktlen;
   struct timeval ts;
   int partial_check;
 } pcap_pkt;
@@ -63,7 +63,7 @@ typedef struct
 {
   char *file;
   u_int16_t base;
-  u_long max_length;
+  unsigned long max_length;
   pcap_pkt *max;
   pcap_pkt *pkts;
 } pcap_pkts;