summaryrefslogtreecommitdiff
path: root/package/ulogd/0003-Use-stdint-types-everywhere.patch
blob: 66408d6d0fc65aa4a65a8f68dc3592d6402c5dc9 (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
From c9337b31f756cae85299c8275b21088ce02885e2 Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Wed, 24 Jun 2015 19:53:34 +0200
Subject: [PATCH] Use stdint types everywhere

Signed-off-by: Felix Janda <felix.janda@posteo.de>
[Rahul Bedarkar:
 - backported from https://git.netfilter.org/ulogd2/commit/?id=c9337b31f756cae85299c8275b21088ce02885e2
 - remove hunk for output/ulogd_output_IPFIX.c as file doesn't exist in version we use]
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
---
 filter/raw2packet/ulogd_raw2packet_BASE.c | 35 +++++++++++++-------------
 filter/ulogd_filter_HWHDR.c               |  6 ++---
 filter/ulogd_filter_IP2HBIN.c             |  4 +--
 filter/ulogd_filter_IP2STR.c              |  2 +-
 filter/ulogd_filter_MARK.c                |  4 +--
 filter/ulogd_filter_PWSNIFF.c             |  4 +--
 include/libipulog/libipulog.h             |  7 +++---
 include/ulogd/addr.h                      |  4 ++-
 include/ulogd/conffile.h                  | 10 ++++----
 include/ulogd/ipfix_protocol.h            | 38 +++++++++++++++-------------
 include/ulogd/ulogd.h                     | 42 +++++++++++++++----------------
 input/packet/ulogd_inppkt_NFLOG.c         | 16 ++++++------
 input/packet/ulogd_inppkt_UNIXSOCK.c      | 34 ++++++++++++-------------
 libipulog/libipulog.c                     |  8 +++---
 output/mysql/ulogd_output_MYSQL.c         |  2 +-
 output/ulogd_output_IPFIX.c               | 20 +++++++--------
 src/addr.c                                |  4 +--
 util/db.c                                 |  2 +-
 util/printpkt.c                           |  6 ++---
 19 files changed, 126 insertions(+), 122 deletions(-)

diff --git a/filter/raw2packet/ulogd_raw2packet_BASE.c b/filter/raw2packet/ulogd_raw2packet_BASE.c
index ad894fc..8a6180c 100644
--- a/filter/raw2packet/ulogd_raw2packet_BASE.c
+++ b/filter/raw2packet/ulogd_raw2packet_BASE.c
@@ -44,6 +44,7 @@
 #include <ulogd/ipfix_protocol.h>
 #include <netinet/if_ether.h>
 #include <string.h>
+#include <linux/types.h>
 
 enum input_keys {
 	INKEY_RAW_PCKT,
@@ -538,7 +539,7 @@ static struct ulogd_key iphdr_rets[] = {
  ***********************************************************************/
 
 static int _interp_tcp(struct ulogd_pluginstance *pi, struct tcphdr *tcph,
-		       u_int32_t len)
+		       uint32_t len)
 {
 	struct ulogd_key *ret = pi->output.keys;
 
@@ -573,7 +574,7 @@ static int _interp_tcp(struct ulogd_pluginstance *pi, struct tcphdr *tcph,
  ***********************************************************************/
 
 static int _interp_udp(struct ulogd_pluginstance *pi, struct udphdr *udph,
-		       u_int32_t len)
+		       uint32_t len)
 		
 {
 	struct ulogd_key *ret = pi->output.keys;
@@ -602,7 +603,7 @@ typedef struct sctphdr {
 } __attribute__((packed)) sctp_sctphdr_t;
 
 static int _interp_sctp(struct ulogd_pluginstance *pi, struct sctphdr *sctph,
-		       u_int32_t len)
+		       uint32_t len)
 		
 {
 	struct ulogd_key *ret = pi->output.keys;
@@ -625,7 +626,7 @@ static int _interp_sctp(struct ulogd_pluginstance *pi, struct sctphdr *sctph,
  ***********************************************************************/
 
 static int _interp_icmp(struct ulogd_pluginstance *pi, struct icmphdr *icmph,
-			u_int32_t len)
+			uint32_t len)
 {
 	struct ulogd_key *ret = pi->output.keys;
 
@@ -663,7 +664,7 @@ static int _interp_icmp(struct ulogd_pluginstance *pi, struct icmphdr *icmph,
  ***********************************************************************/
 
 static int _interp_icmpv6(struct ulogd_pluginstance *pi, struct icmp6_hdr *icmph,
-			  u_int32_t len)
+			  uint32_t len)
 {
 	struct ulogd_key *ret = pi->output.keys;
 
@@ -691,7 +692,7 @@ static int _interp_icmpv6(struct ulogd_pluginstance *pi, struct icmp6_hdr *icmph
  * 			IPSEC HEADER 
  ***********************************************************************/
 static int _interp_ahesp(struct ulogd_pluginstance *pi, void *protoh,
-			 u_int32_t len)
+			 uint32_t len)
 {
 #if 0
 	struct ulogd_key *ret = pi->output.keys;
@@ -711,14 +712,14 @@ static int _interp_ahesp(struct ulogd_pluginstance *pi, void *protoh,
  * 			IP HEADER
  ***********************************************************************/
 
-static int _interp_iphdr(struct ulogd_pluginstance *pi, u_int32_t len)
+static int _interp_iphdr(struct ulogd_pluginstance *pi, uint32_t len)
 {
 	struct ulogd_key *ret = pi->output.keys;
 	struct iphdr *iph =
 		ikey_get_ptr(&pi->input.keys[INKEY_RAW_PCKT]);
-	void *nexthdr = (u_int32_t *)iph + iph->ihl;
+	void *nexthdr = (uint32_t *)iph + iph->ihl;
 
-	if (len < sizeof(struct iphdr) || len <= (u_int32_t)(iph->ihl * 4))
+	if (len < sizeof(struct iphdr) || len <= (uint32_t)(iph->ihl * 4))
 		return ULOGD_IRET_OK;
 	len -= iph->ihl * 4;
 
@@ -759,7 +760,7 @@ static int _interp_iphdr(struct ulogd_pluginstance *pi, u_int32_t len)
  * 			IPv6 HEADER
  ***********************************************************************/
 
-static int ip6_ext_hdr(u_int8_t nexthdr)
+static int ip6_ext_hdr(uint8_t nexthdr)
 {
 	switch (nexthdr) {
 	case IPPROTO_HOPOPTS:
@@ -774,12 +775,12 @@ static int ip6_ext_hdr(u_int8_t nexthdr)
 	}
 }
 
-static int _interp_ipv6hdr(struct ulogd_pluginstance *pi, u_int32_t len)
+static int _interp_ipv6hdr(struct ulogd_pluginstance *pi, uint32_t len)
 {
 	struct ulogd_key *ret = pi->output.keys;
 	struct ip6_hdr *ipv6h = ikey_get_ptr(&pi->input.keys[INKEY_RAW_PCKT]);
 	unsigned int ptr, hdrlen = 0;
-	u_int8_t curhdr;
+	uint8_t curhdr;
 	int fragment = 0;
 
 	if (len < sizeof(struct ip6_hdr))
@@ -889,7 +890,7 @@ out:
 /***********************************************************************
  * 			ARP HEADER
  ***********************************************************************/
-static int _interp_arp(struct ulogd_pluginstance *pi, u_int32_t len)
+static int _interp_arp(struct ulogd_pluginstance *pi, uint32_t len)
 {
 	struct ulogd_key *ret = pi->output.keys;
 	const struct ether_arp *arph =
@@ -914,9 +915,9 @@ static int _interp_arp(struct ulogd_pluginstance *pi, u_int32_t len)
  * 			ETHER HEADER
  ***********************************************************************/
 
-static int _interp_bridge(struct ulogd_pluginstance *pi, u_int32_t len)
+static int _interp_bridge(struct ulogd_pluginstance *pi, uint32_t len)
 {
-	const u_int16_t proto =
+	const uint16_t proto =
 		ikey_get_u16(&pi->input.keys[INKEY_OOB_PROTOCOL]);
 
 	switch (proto) {
@@ -938,8 +939,8 @@ static int _interp_bridge(struct ulogd_pluginstance *pi, u_int32_t len)
 
 static int _interp_pkt(struct ulogd_pluginstance *pi)
 {
-	u_int32_t len = ikey_get_u32(&pi->input.keys[INKEY_RAW_PCKTLEN]);
-	u_int8_t family = ikey_get_u8(&pi->input.keys[INKEY_OOB_FAMILY]);
+	uint32_t len = ikey_get_u32(&pi->input.keys[INKEY_RAW_PCKTLEN]);
+	uint8_t family = ikey_get_u8(&pi->input.keys[INKEY_OOB_FAMILY]);
 	struct ulogd_key *ret = pi->output.keys;
 
 	okey_set_u16(&ret[KEY_OOB_PROTOCOL],
diff --git a/filter/ulogd_filter_HWHDR.c b/filter/ulogd_filter_HWHDR.c
index 3b095c9..10c95c4 100644
--- a/filter/ulogd_filter_HWHDR.c
+++ b/filter/ulogd_filter_HWHDR.c
@@ -143,10 +143,10 @@ static void *hwhdr_get_daddr(struct ulogd_key *inp)
 	return ikey_get_ptr(&inp[KEY_RAW_MAC]);
 }
 
-static u_int16_t hwhdr_get_len(struct ulogd_key *inp)
+static uint16_t hwhdr_get_len(struct ulogd_key *inp)
 {
 	void *len = ikey_get_ptr(&inp[KEY_RAW_MAC]) + 2 * ETH_ALEN;
-	return ntohs(*(u_int16_t *) len);
+	return ntohs(*(uint16_t *) len);
 }
 static int parse_ethernet(struct ulogd_key *ret, struct ulogd_key *inp)
 {
@@ -171,7 +171,7 @@ static int interp_mac2str(struct ulogd_pluginstance *pi)
 {
 	struct ulogd_key *ret = pi->output.keys;
 	struct ulogd_key *inp = pi->input.keys;
-	u_int16_t type = 0;
+	uint16_t type = 0;
 
 	if (pp_is_valid(inp, KEY_OOB_PROTOCOL))
 		okey_set_u16(&ret[KEY_MAC_PROTOCOL],
diff --git a/filter/ulogd_filter_IP2HBIN.c b/filter/ulogd_filter_IP2HBIN.c
index 4fd3ff1..087e824 100644
--- a/filter/ulogd_filter_IP2HBIN.c
+++ b/filter/ulogd_filter_IP2HBIN.c
@@ -116,8 +116,8 @@ static int interp_ip2hbin(struct ulogd_pluginstance *pi)
 {
 	struct ulogd_key *ret = pi->output.keys;
 	struct ulogd_key *inp = pi->input.keys;
-	u_int8_t family = ikey_get_u8(&inp[KEY_OOB_FAMILY]);
-	u_int8_t convfamily = family;
+	uint8_t family = ikey_get_u8(&inp[KEY_OOB_FAMILY]);
+	uint8_t convfamily = family;
 	int i;
 
 	switch (family) {
diff --git a/filter/ulogd_filter_IP2STR.c b/filter/ulogd_filter_IP2STR.c
index 732e1ef..66324b0 100644
--- a/filter/ulogd_filter_IP2STR.c
+++ b/filter/ulogd_filter_IP2STR.c
@@ -168,7 +168,7 @@ static int ip2str(struct ulogd_key *inp, int index, int oindex)
 	}
 
 	switch (convfamily) {
-		u_int32_t ip;
+		uint32_t ip;
 	case AF_INET6:
 		inet_ntop(AF_INET6,
 			  ikey_get_u128(&inp[index]),
diff --git a/filter/ulogd_filter_MARK.c b/filter/ulogd_filter_MARK.c
index 7807f63..149725d 100644
--- a/filter/ulogd_filter_MARK.c
+++ b/filter/ulogd_filter_MARK.c
@@ -73,14 +73,14 @@ static int interp_mark(struct ulogd_pluginstance *pi)
 	if (pp_is_valid(inp, KEY_CT_MARK)) {
 		if ((ikey_get_u32(&inp[KEY_CT_MARK]) &
 			pi->config_kset->ces[MARK_MASK].u.value) !=
-			(u_int32_t) pi->config_kset->ces[MARK_MARK].u.value
+			(uint32_t) pi->config_kset->ces[MARK_MARK].u.value
 		   ) {
 			return ULOGD_IRET_STOP;
 		}
 	} else if (pp_is_valid(inp, KEY_OOB_MARK)) {
 		if ((ikey_get_u32(&inp[KEY_OOB_MARK]) &
 			pi->config_kset->ces[MARK_MASK].u.value) !=
-			(u_int32_t) pi->config_kset->ces[MARK_MARK].u.value
+			(uint32_t) pi->config_kset->ces[MARK_MARK].u.value
 		   ) {
 			return ULOGD_IRET_STOP;
 		}
diff --git a/filter/ulogd_filter_PWSNIFF.c b/filter/ulogd_filter_PWSNIFF.c
index a3e2b42..934ff0e 100644
--- a/filter/ulogd_filter_PWSNIFF.c
+++ b/filter/ulogd_filter_PWSNIFF.c
@@ -39,7 +39,7 @@
 #define PORT_POP3	110
 #define PORT_FTP	21
 
-static u_int16_t pwsniff_ports[] = {
+static uint16_t pwsniff_ports[] = {
 	PORT_POP3,
 	PORT_FTP,
 	/* feel free to include any other ports here, provided that their
@@ -72,7 +72,7 @@ static int interp_pwsniff(struct ulogd_pluginstance *pi)
 		return ULOGD_IRET_STOP;
 	
 	iph = (struct iphdr *) pi->input.keys[0].u.value.ptr;
-	protoh = (u_int32_t *)iph + iph->ihl;
+	protoh = (uint32_t *)iph + iph->ihl;
 	tcph = protoh;
 	tcplen = ntohs(iph->tot_len) - iph->ihl * 4;
 
diff --git a/include/libipulog/libipulog.h b/include/libipulog/libipulog.h
index b3c9616..21b4315 100644
--- a/include/libipulog/libipulog.h
+++ b/include/libipulog/libipulog.h
@@ -4,10 +4,9 @@
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
-#include <asm/types.h>
+#include <stdint.h>
 #include <linux/netlink.h>
 #include <net/if.h>
 #include <linux/netfilter_ipv4/ipt_ULOG.h>
@@ -20,9 +19,9 @@
 struct ipulog_handle;
 extern int ipulog_errno;
 
-u_int32_t ipulog_group2gmask(u_int32_t group);
+uint32_t ipulog_group2gmask(uint32_t group);
 
-struct ipulog_handle *ipulog_create_handle(u_int32_t gmask, u_int32_t rmem);
+struct ipulog_handle *ipulog_create_handle(uint32_t gmask, uint32_t rmem);
 
 void ipulog_destroy_handle(struct ipulog_handle *h);
 
diff --git a/include/ulogd/addr.h b/include/ulogd/addr.h
index b4432e3..2259b6c 100644
--- a/include/ulogd/addr.h
+++ b/include/ulogd/addr.h
@@ -8,7 +8,9 @@
 #ifndef _ADDR_H
 #define _ADDR_H
 
-u_int32_t ulogd_bits2netmask(int bits);
+#include <stdint.h>
+
+uint32_t ulogd_bits2netmask(int bits);
 void ulogd_ipv6_cidr2mask_host(uint8_t cidr, uint32_t *res);
 void ulogd_ipv6_addr2addr_host(uint32_t *addr, uint32_t *res);
 
diff --git a/include/ulogd/conffile.h b/include/ulogd/conffile.h
index 69a6f70..1f3d563 100644
--- a/include/ulogd/conffile.h
+++ b/include/ulogd/conffile.h
@@ -7,7 +7,7 @@
 #ifndef _CONFFILE_H
 #define _CONFFILE_H
 
-#include <sys/types.h>
+#include <stdint.h>
 
 /* errors returned by config functions */
 enum {
@@ -45,10 +45,10 @@ enum {
 
 struct config_entry {
 	char key[CONFIG_KEY_LEN];	/* name of config directive */
-	u_int8_t type;			/* type; see above */
-	u_int8_t options;		/* options; see above  */
-	u_int8_t hit;			/* found? */
-	u_int8_t flag;			/* tune setup of option */
+	uint8_t type;			/* type; see above */
+	uint8_t options;		/* options; see above  */
+	uint8_t hit;			/* found? */
+	uint8_t flag;			/* tune setup of option */
 	union {
 		char string[CONFIG_VAL_STRING_LEN];
 		int value;
diff --git a/include/ulogd/ipfix_protocol.h b/include/ulogd/ipfix_protocol.h
index 5d7e46a..aef47f0 100644
--- a/include/ulogd/ipfix_protocol.h
+++ b/include/ulogd/ipfix_protocol.h
@@ -1,6 +1,8 @@
 #ifndef _IPFIX_PROTOCOL_H
 #define _IPFIX_PROTOCOL_H
 
+#include <stdint.h>
+
 /* This header file defines structures for the IPFIX protocol in accordance with
  * draft-ietf-ipfix-protocol-19.txt */
 
@@ -11,29 +13,29 @@
 
 /* Section 3.1 */
 struct ipfix_msg_hdr {
-	u_int16_t	version;
-	u_int16_t	length;
-	u_int32_t	export_time;
-	u_int32_t	seq;
-	u_int32_t	source_id;
+	uint16_t	version;
+	uint16_t	length;
+	uint32_t	export_time;
+	uint32_t	seq;
+	uint32_t	source_id;
 };
 
 /* Section 3.4.1 */
 struct ipfix_templ_rec_hdr {
-	u_int16_t	templ_id;
-	u_int16_t	field_count;
+	uint16_t	templ_id;
+	uint16_t	field_count;
 };
 
 /* Section 3.2 */
 struct ipfix_ietf_field {
-	u_int16_t	type;
-	u_int16_t	length;
+	uint16_t	type;
+	uint16_t	length;
 };
 
 struct ipfix_vendor_field {
-	u_int16_t	type;
-	u_int16_t	length;
-	u_int32_t	enterprise_num;
+	uint16_t	type;
+	uint16_t	length;
+	uint32_t	enterprise_num;
 };
 
 /* Information Element Identifiers as of draft-ietf-ipfix-info-11.txt */
@@ -219,13 +221,13 @@ enum {
 /* Information elements of the netfilter vendor id */
 enum {
 	IPFIX_NF_rawpacket		= 1,	/* pointer */
-	IPFIX_NF_rawpacket_length	= 2,	/* u_int32_t */
+	IPFIX_NF_rawpacket_length	= 2,	/* uint32_t */
 	IPFIX_NF_prefix			= 3,	/* string */
-	IPFIX_NF_mark			= 4,	/* u_int32_t */
-	IPFIX_NF_hook			= 5,	/* u_int8_t */
-	IPFIX_NF_conntrack_id		= 6,	/* u_int32_t */
-	IPFIX_NF_seq_local		= 7,	/* u_int32_t */
-	IPFIX_NF_seq_global		= 8,	/* u_int32_t */
+	IPFIX_NF_mark			= 4,	/* uint32_t */
+	IPFIX_NF_hook			= 5,	/* uint8_t */
+	IPFIX_NF_conntrack_id		= 6,	/* uint32_t */
+	IPFIX_NF_seq_local		= 7,	/* uint32_t */
+	IPFIX_NF_seq_global		= 8,	/* uint32_t */
 };
 
 #endif
diff --git a/include/ulogd/ulogd.h b/include/ulogd/ulogd.h
index cf26a15..2e38195 100644
--- a/include/ulogd/ulogd.h
+++ b/include/ulogd/ulogd.h
@@ -85,17 +85,17 @@ enum ulogd_dtype {
 /* structure describing an input  / output parameter of a plugin */
 struct ulogd_key {
 	/* length of the returned value (only for lengthed types */
-	u_int32_t len;
+	uint32_t len;
 	/* type of the returned value (ULOGD_DTYPE_...) */
-	u_int16_t type;
+	uint16_t type;
 	/* flags (i.e. free, ...) */
-	u_int16_t flags;
+	uint16_t flags;
 	/* name of this key */
 	char name[ULOGD_MAX_KEYLEN+1];
 	/* IETF IPFIX attribute ID */
 	struct {
-		u_int32_t	vendor;
-		u_int16_t	field_id;
+		uint32_t	vendor;
+		uint16_t	field_id;
 	} ipfix;
 
 	/* Store field name for Common Information Model */
@@ -104,12 +104,12 @@ struct ulogd_key {
 	union {
 		/* and finally the returned value */
 		union {
-			u_int8_t	b;
-			u_int8_t	ui8;
-			u_int16_t	ui16;
-			u_int32_t	ui32;
-			u_int64_t	ui64;
-			u_int32_t	ui128[4];
+			uint8_t	b;
+			uint8_t	ui8;
+			uint16_t	ui16;
+			uint32_t	ui32;
+			uint64_t	ui64;
+			uint32_t	ui128[4];
 			int8_t		i8;
 			int16_t		i16;
 			int32_t		i32;
@@ -130,31 +130,31 @@ struct ulogd_keyset {
 	unsigned int type;
 };
 
-static inline void okey_set_b(struct ulogd_key *key, u_int8_t value)
+static inline void okey_set_b(struct ulogd_key *key, uint8_t value)
 {
 	key->u.value.b = value;
 	key->flags |= ULOGD_RETF_VALID;
 }
 
-static inline void okey_set_u8(struct ulogd_key *key, u_int8_t value)
+static inline void okey_set_u8(struct ulogd_key *key, uint8_t value)
 {
 	key->u.value.ui8 = value;
 	key->flags |= ULOGD_RETF_VALID;
 }
 
-static inline void okey_set_u16(struct ulogd_key *key, u_int16_t value)
+static inline void okey_set_u16(struct ulogd_key *key, uint16_t value)
 {
 	key->u.value.ui16 = value;
 	key->flags |= ULOGD_RETF_VALID;
 }
 
-static inline void okey_set_u32(struct ulogd_key *key, u_int32_t value)
+static inline void okey_set_u32(struct ulogd_key *key, uint32_t value)
 {
 	key->u.value.ui32 = value;
 	key->flags |= ULOGD_RETF_VALID;
 }
 
-static inline void okey_set_u64(struct ulogd_key *key, u_int64_t value)
+static inline void okey_set_u64(struct ulogd_key *key, uint64_t value)
 {
 	key->u.value.ui64 = value;
 	key->flags |= ULOGD_RETF_VALID;
@@ -172,22 +172,22 @@ static inline void okey_set_ptr(struct ulogd_key *key, void *value)
 	key->flags |= ULOGD_RETF_VALID;
 }
 
-static inline u_int8_t ikey_get_u8(struct ulogd_key *key)
+static inline uint8_t ikey_get_u8(struct ulogd_key *key)
 {
 	return key->u.source->u.value.ui8;
 }
 
-static inline u_int16_t ikey_get_u16(struct ulogd_key *key)
+static inline uint16_t ikey_get_u16(struct ulogd_key *key)
 {
 	return key->u.source->u.value.ui16;
 }
 
-static inline u_int32_t ikey_get_u32(struct ulogd_key *key)
+static inline uint32_t ikey_get_u32(struct ulogd_key *key)
 {
 	return key->u.source->u.value.ui32;
 }
 
-static inline u_int64_t ikey_get_u64(struct ulogd_key *key)
+static inline uint64_t ikey_get_u64(struct ulogd_key *key)
 {
 	return key->u.source->u.value.ui64;
 }
@@ -292,7 +292,7 @@ void ulogd_propagate_results(struct ulogd_pluginstance *pi);
 void ulogd_register_plugin(struct ulogd_plugin *me);
 
 /* allocate a new ulogd_key */
-struct ulogd_key *alloc_ret(const u_int16_t type, const char*);
+struct ulogd_key *alloc_ret(const uint16_t type, const char*);
 
 /* write a message to the daemons' logfile */
 void __ulogd_log(int level, char *file, int line, const char *message, ...);
diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index 6196626..a367959 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -315,7 +315,7 @@ static struct ulogd_key output_keys[] = {
 };
 
 static inline int
-interp_packet(struct ulogd_pluginstance *upi, u_int8_t pf_family,
+interp_packet(struct ulogd_pluginstance *upi, uint8_t pf_family,
 	      struct nflog_data *ldata)
 {
 	struct ulogd_key *ret = upi->output.keys;
@@ -326,12 +326,12 @@ interp_packet(struct ulogd_pluginstance *upi, u_int8_t pf_family,
 	int payload_len = nflog_get_payload(ldata, &payload);
 	char *prefix = nflog_get_prefix(ldata);
 	struct timeval ts;
-	u_int32_t mark = nflog_get_nfmark(ldata);
-	u_int32_t indev = nflog_get_indev(ldata);
-	u_int32_t outdev = nflog_get_outdev(ldata);
-	u_int32_t seq;
-	u_int32_t uid;
-	u_int32_t gid;
+	uint32_t mark = nflog_get_nfmark(ldata);
+	uint32_t indev = nflog_get_indev(ldata);
+	uint32_t outdev = nflog_get_outdev(ldata);
+	uint32_t seq;
+	uint32_t uid;
+	uint32_t gid;
 
 	okey_set_u8(&ret[NFLOG_KEY_OOB_FAMILY], 
 		    pf_family);
@@ -493,7 +493,7 @@ static int configure(struct ulogd_pluginstance *upi,
 	return 0;
 }
 
-static int become_system_logging(struct ulogd_pluginstance *upi, u_int8_t pf)
+static int become_system_logging(struct ulogd_pluginstance *upi, uint8_t pf)
 {
 	struct nflog_input *ui = (struct nflog_input *) upi->private;
 
diff --git a/input/packet/ulogd_inppkt_UNIXSOCK.c b/input/packet/ulogd_inppkt_UNIXSOCK.c
index e4009f3..39944bf 100644
--- a/input/packet/ulogd_inppkt_UNIXSOCK.c
+++ b/input/packet/ulogd_inppkt_UNIXSOCK.c
@@ -336,10 +336,10 @@ enum ulogd2_option_type {
 	ULOGD2_OPT_PREFIX,	/* log prefix (string) */
 	ULOGD2_OPT_OOB_IN,	/* input device (string) */
 	ULOGD2_OPT_OOB_OUT,	/* output device (string) */
-	ULOGD2_OPT_OOB_TIME_SEC,	/* packet arrival time (u_int32_t) */
+	ULOGD2_OPT_OOB_TIME_SEC,	/* packet arrival time (uint32_t) */
 
 	ULOGD2_OPT_USER=200,	/* user name (string) */
-	ULOGD2_OPT_USERID,	/* user id (u_int32_t) */
+	ULOGD2_OPT_USERID,	/* user id (uint32_t) */
 	ULOGD2_OPT_OSNAME,	/* OS name (string) */
 	ULOGD2_OPT_OSREL,	/* OS release (string) */
 	ULOGD2_OPT_OSVERS,	/* OS version (string) */
@@ -367,15 +367,15 @@ struct ulogd_unixsock_option_t  {
 #define USOCK_ALIGNTO 8
 #define USOCK_ALIGN(len) ( ((len)+USOCK_ALIGNTO-1) & ~(USOCK_ALIGNTO-1) )
 
-static int handle_packet(struct ulogd_pluginstance *upi, struct ulogd_unixsock_packet_t *pkt, u_int16_t total_len)
+static int handle_packet(struct ulogd_pluginstance *upi, struct ulogd_unixsock_packet_t *pkt, uint16_t total_len)
 {
 	char *data = NULL;
 	struct iphdr *ip;
 	struct ulogd_key *ret = upi->output.keys;
-	u_int8_t oob_family;
-	u_int16_t payload_len;
-	u_int32_t option_number;
-	u_int32_t option_length;
+	uint8_t oob_family;
+	uint16_t payload_len;
+	uint32_t option_number;
+	uint32_t option_length;
 	char *buf;
 	struct ulogd_unixsock_option_t *option;
 	int new_offset;
@@ -398,7 +398,7 @@ static int handle_packet(struct ulogd_pluginstance *upi, struct ulogd_unixsock_p
 	okey_set_u32(&ret[UNIXSOCK_KEY_RAW_PCKTLEN], payload_len);
 
 	/* options */
-	if (total_len > payload_len + sizeof(u_int16_t)) {
+	if (total_len > payload_len + sizeof(uint16_t)) {
 		/* option starts at the next aligned address after the payload */
 		new_offset = USOCK_ALIGN(payload_len);
 		options_start = (void*)ip + new_offset;
@@ -431,13 +431,13 @@ static int handle_packet(struct ulogd_pluginstance *upi, struct ulogd_unixsock_p
 				okey_set_ptr(&ret[UNIXSOCK_KEY_OOB_OUT], buf);
 				break;
 			case ULOGD2_OPT_OOB_TIME_SEC:
-				okey_set_u32(&ret[UNIXSOCK_KEY_OOB_TIME_SEC], *(u_int32_t*)buf);
+				okey_set_u32(&ret[UNIXSOCK_KEY_OOB_TIME_SEC], *(uint32_t*)buf);
 				break;
 			case ULOGD2_OPT_USER:
 				okey_set_ptr(&ret[UNIXSOCK_KEY_NUFW_USER_NAME], buf);
 				break;
 			case ULOGD2_OPT_USERID:
-				okey_set_u32(&ret[UNIXSOCK_KEY_NUFW_USER_ID], *(u_int32_t*)buf);
+				okey_set_u32(&ret[UNIXSOCK_KEY_NUFW_USER_ID], *(uint32_t*)buf);
 				break;
 			case ULOGD2_OPT_OSNAME:
 				okey_set_ptr(&ret[UNIXSOCK_KEY_NUFW_OS_NAME], buf);
@@ -452,7 +452,7 @@ static int handle_packet(struct ulogd_pluginstance *upi, struct ulogd_unixsock_p
 				okey_set_ptr(&ret[UNIXSOCK_KEY_NUFW_APP_NAME], buf);
 				break;
 			case ULOGD2_OPT_STATE:
-				okey_set_u8(&ret[UNIXSOCK_KEY_RAW_LABEL], *(u_int8_t*)buf);
+				okey_set_u8(&ret[UNIXSOCK_KEY_RAW_LABEL], *(uint8_t*)buf);
 				break;
 			default:
 				ulogd_log(ULOGD_NOTICE,
@@ -595,8 +595,8 @@ static int unixsock_instance_read_cb(int fd, unsigned int what, void *param)
 	struct ulogd_pluginstance *upi = param;
 	struct unixsock_input *ui = (struct unixsock_input*)upi->private;
 	int len;
-	u_int16_t needed_len;
-	u_int32_t packet_sig;
+	uint16_t needed_len;
+	uint32_t packet_sig;
 	struct ulogd_unixsock_packet_t *unixsock_packet;
 
 	char buf[4096];
@@ -642,7 +642,7 @@ static int unixsock_instance_read_cb(int fd, unsigned int what, void *param)
 
 		needed_len = ntohs(unixsock_packet->total_size);
 
-		if (ui->unixsock_buf_avail >= needed_len + sizeof(u_int32_t)) {
+		if (ui->unixsock_buf_avail >= needed_len + sizeof(uint32_t)) {
 			ulogd_log(ULOGD_DEBUG,
 			"  We have enough data (%d bytes required), handling packet\n",
 					needed_len);
@@ -651,11 +651,11 @@ static int unixsock_instance_read_cb(int fd, unsigned int what, void *param)
 				return -1;
 			}
 			/* consume data */
-			ui->unixsock_buf_avail -= (sizeof(u_int32_t) + needed_len);
+			ui->unixsock_buf_avail -= (sizeof(uint32_t) + needed_len);
 			if (ui->unixsock_buf_avail > 0) {
 				/* we need to shift data .. */
 				memmove(ui->unixsock_buf,
-						ui->unixsock_buf + (sizeof(u_int32_t) + needed_len) ,
+						ui->unixsock_buf + (sizeof(uint32_t) + needed_len) ,
 						ui->unixsock_buf_avail);
 			} else {
 				/* input buffer is empty, do not loop */
@@ -664,7 +664,7 @@ static int unixsock_instance_read_cb(int fd, unsigned int what, void *param)
 
 		} else {
 			ulogd_log(ULOGD_DEBUG, "  We have %d bytes, but need %d. Requesting more\n",
-					ui->unixsock_buf_avail, needed_len + sizeof(u_int32_t));
+					ui->unixsock_buf_avail, needed_len + sizeof(uint32_t));
 			return 0;
 		}
 
diff --git a/libipulog/libipulog.c b/libipulog/libipulog.c
index ab28bb4..b49f7f2 100644
--- a/libipulog/libipulog.c
+++ b/libipulog/libipulog.c
@@ -33,7 +33,7 @@
 struct ipulog_handle
 {
 	int fd;
-	u_int8_t blocking;
+	uint8_t blocking;
 	struct sockaddr_nl local;
 	struct sockaddr_nl peer;
 	struct nlmsghdr* last_nlhdr;
@@ -112,7 +112,7 @@ char *ipulog_strerror(int errcode)
 }
 
 /* convert a netlink group (1-32) to a group_mask suitable for create_handle */
-u_int32_t ipulog_group2gmask(u_int32_t group)
+uint32_t ipulog_group2gmask(uint32_t group)
 {
 	if (group < 1 || group > 32)
 	{
@@ -123,8 +123,8 @@ u_int32_t ipulog_group2gmask(u_int32_t group)
 }
 
 /* create a ipulog handle for the reception of packets sent to gmask */
-struct ipulog_handle *ipulog_create_handle(u_int32_t gmask, 
-					   u_int32_t rcvbufsize)
+struct ipulog_handle *ipulog_create_handle(uint32_t gmask,
+					   uint32_t rcvbufsize)
 {
 	struct ipulog_handle *h;
 	int status;
diff --git a/output/mysql/ulogd_output_MYSQL.c b/output/mysql/ulogd_output_MYSQL.c
index 0a1ebfc..643320c 100644
--- a/output/mysql/ulogd_output_MYSQL.c
+++ b/output/mysql/ulogd_output_MYSQL.c
@@ -174,7 +174,7 @@ static int open_db_mysql(struct ulogd_pluginstance *upi)
 	struct mysql_instance *mi = (struct mysql_instance *) upi->private;
 	unsigned int connect_timeout = timeout_ce(upi->config_kset).u.value;
 	char *server = host_ce(upi->config_kset).u.string;
-	u_int16_t port = port_ce(upi->config_kset).u.value;
+	uint16_t port = port_ce(upi->config_kset).u.value;
 	char *user = user_ce(upi->config_kset).u.string;
 	char *pass = pass_ce(upi->config_kset).u.string;
 	char *db = db_ce(upi->config_kset).u.string;
diff --git a/src/addr.c b/src/addr.c
index 2672fab..41435dc 100644
--- a/src/addr.c
+++ b/src/addr.c
@@ -22,9 +22,9 @@
 #include <ulogd/ulogd.h>
 #include <ulogd/addr.h>
 
-u_int32_t ulogd_bits2netmask(int bits)
+uint32_t ulogd_bits2netmask(int bits)
 {
-	u_int32_t netmask, bm;
+	uint32_t netmask, bm;
 
 	if (bits >= 32 || bits < 0)
 		return(~0);
diff --git a/util/db.c b/util/db.c
index 24966a5..c9aec41 100644
--- a/util/db.c
+++ b/util/db.c
@@ -362,7 +362,7 @@ static void __format_query_db(struct ulogd_pluginstance *upi, char *start)
 			sprintf(stmt_ins, "%u,", res->u.value.ui16);
 			break;
 		case ULOGD_RET_IPADDR:
-			/* fallthrough when logging IP as u_int32_t */
+			/* fallthrough when logging IP as uint32_t */
 		case ULOGD_RET_UINT32:
 			sprintf(stmt_ins, "%u,", res->u.value.ui32);
 			break;
diff --git a/util/printpkt.c b/util/printpkt.c
index eb6cfbf..69a47ca 100644
--- a/util/printpkt.c
+++ b/util/printpkt.c
@@ -199,7 +199,7 @@ static int printpkt_ipv4(struct ulogd_key *res, char *buf)
 {
 	char *buf_cur = buf;
 	char tmp[INET_ADDRSTRLEN];
-	u_int32_t paddr;
+	uint32_t paddr;
 
 	if (pp_is_valid(res, KEY_IP_SADDR))
 		buf_cur += sprintf(buf_cur, "SRC=%s ",
@@ -363,8 +363,8 @@ static int printpkt_ipv6(struct ulogd_key *res, char *buf)
 int printpkt_arp(struct ulogd_key *res, char *buf)
 {
 	char *buf_cur = buf;
-	u_int16_t code = 0;
-	u_int8_t *mac;
+	uint16_t code = 0;
+	uint8_t *mac;
 
 	if (pp_is_valid(res, KEY_ARP_SPA))
 		buf_cur += sprintf(buf_cur, "SRC=%s ",
-- 
2.6.2