Permalink
Browse files

ANSIfy, to reduce diffs with *BSDs.

based on diff from dunceor at gmail.com.
XXX not tested yet, sorry, we need to ressurect buildlab configs.

random thoughts:
- IGMPv3 support needs a serious cleanup.  argument passing is horrible, style
  does not meet style(9) at all.  i'm afraid there could be a lot of bugs.
- DCCP/SCTP/NAT-PT need someone to maintain them, otherwise we should drop
  them at once.
- we should pick a platform (one of *BSD) and try to get KAME tree in sync
  with more recent version of *BSD.  otherwise, KAME tree gets more and more
  out-of-date.
  • Loading branch information...
1 parent 3ac8753 commit f349701ff749f7de15fe3033e92e0bd3c4387f95 itojun committed Jun 14, 2007
Showing with 2,831 additions and 4,480 deletions.
  1. +6 −6 kame/sys/crypto/blowfish/blowfish.h
  2. +32 −31 kame/sys/crypto/des/des.h
  3. +15 −16 kame/sys/crypto/md5.c
  4. +5 −5 kame/sys/crypto/md5.h
  5. +8 −15 kame/sys/crypto/sha1.c
  6. +5 −5 kame/sys/crypto/sha1.h
  7. +18 −18 kame/sys/crypto/sha2/sha2.h
  8. +79 −76 kame/sys/crypto/twofish/twofish.h
  9. +5 −5 kame/sys/crypto/twofish/twofish2.c
  10. +17 −45 kame/sys/kern/uipc_mbuf2.c
  11. +17 −26 kame/sys/net/if_dummy.c
  12. +15 −25 kame/sys/net/if_faith.c
  13. +2 −2 kame/sys/net/if_faith.h
  14. +19 −39 kame/sys/net/if_gif.c
  15. +10 −10 kame/sys/net/if_gif.h
  16. +20 −49 kame/sys/net/if_ist.c
  17. +14 −32 kame/sys/net/if_mip.c
  18. +19 −39 kame/sys/net/if_nemo.c
  19. +10 −10 kame/sys/net/if_nemo.h
  20. +34 −55 kame/sys/net/if_stf.c
  21. +3 −3 kame/sys/net/if_stf.h
  22. +28 −72 kame/sys/net/mipsock.c
  23. +5 −8 kame/sys/net/net_osdep.c
  24. +2 −2 kame/sys/net/net_osdep.h
  25. +54 −97 kame/sys/net/radix_art.c
  26. +11 −11 kame/sys/net/radix_art.h
  27. +15 −33 kame/sys/net/radix_mpath.c
  28. +14 −15 kame/sys/net/radix_mpath.h
  29. +14 −15 kame/sys/netinet/icmp6.h
  30. +2 −5 kame/sys/netinet/in4_cksum.c
  31. +10 −26 kame/sys/netinet/in_gif.c
  32. +7 −7 kame/sys/netinet/in_gif.h
  33. +1 −2 kame/sys/netinet/ip6mh.h
  34. +5 −17 kame/sys/netinet/ip_ecn.c
  35. +5 −5 kame/sys/netinet/ip_ecn.h
  36. +38 −72 kame/sys/netinet/ip_encap.c
  37. +15 −15 kame/sys/netinet/ip_encap.h
  38. +21 −21 kame/sys/netinet6/ah.h
  39. +6 −12 kame/sys/netinet6/ah_aesxcbcmac.c
  40. +7 −7 kame/sys/netinet6/ah_aesxcbcmac.h
  41. +116 −190 kame/sys/netinet6/ah_core.c
  42. +6 −18 kame/sys/netinet6/ah_input.c
  43. +8 −16 kame/sys/netinet6/ah_output.c
  44. +9 −23 kame/sys/netinet6/dest6.c
  45. +28 −28 kame/sys/netinet6/esp.h
  46. +8 −21 kame/sys/netinet6/esp_aesctr.c
  47. +9 −9 kame/sys/netinet6/esp_aesctr.h
  48. +100 −156 kame/sys/netinet6/esp_core.c
  49. +6 −18 kame/sys/netinet6/esp_input.c
  50. +11 −19 kame/sys/netinet6/esp_output.c
  51. +7 −16 kame/sys/netinet6/esp_rijndael.c
  52. +8 −8 kame/sys/netinet6/esp_rijndael.h
  53. +6 −16 kame/sys/netinet6/esp_twofish.c
  54. +8 −8 kame/sys/netinet6/esp_twofish.h
  55. +19 −26 kame/sys/netinet6/frag6.c
  56. +67 −116 kame/sys/netinet6/icmp6.c
  57. +39 −85 kame/sys/netinet6/in6.c
  58. +53 −53 kame/sys/netinet6/in6.h
  59. +2 −5 kame/sys/netinet6/in6_cksum.c
  60. +11 −27 kame/sys/netinet6/in6_gif.c
  61. +7 −7 kame/sys/netinet6/in6_gif.h
  62. +35 −45 kame/sys/netinet6/in6_ifattach.c
  63. +7 −7 kame/sys/netinet6/in6_ifattach.h
  64. +63 −118 kame/sys/netinet6/in6_msf.c
  65. +2 −2 kame/sys/netinet6/in6_proto.c
  66. +4 −3 kame/sys/netinet6/in6_rmx.c
  67. +58 −87 kame/sys/netinet6/in6_src.c
  68. +33 −33 kame/sys/netinet6/in6_var.h
  69. +2 −5 kame/sys/netinet6/ip6_forward.c
  70. +22 −22 kame/sys/netinet6/ip6_fw.c
  71. +3 −3 kame/sys/netinet6/ip6_fw.h
  72. +34 −76 kame/sys/netinet6/ip6_input.c
  73. +42 −86 kame/sys/netinet6/ip6_mroute.c
  74. +8 −8 kame/sys/netinet6/ip6_mroute.h
  75. +106 −167 kame/sys/netinet6/ip6_output.c
  76. +71 −81 kame/sys/netinet6/ip6_var.h
  77. +16 −16 kame/sys/netinet6/ip6protosw.h
  78. +10 −10 kame/sys/netinet6/ipcomp.h
  79. +17 −28 kame/sys/netinet6/ipcomp_core.c
  80. +10 −17 kame/sys/netinet6/ipcomp_output.c
  81. +162 −308 kame/sys/netinet6/ipsec.c
  82. +71 −77 kame/sys/netinet6/ipsec.h
  83. +62 −119 kame/sys/netinet6/mip6.c
  84. +23 −55 kame/sys/netinet6/mld6.c
  85. +142 −210 kame/sys/netinet6/mldv2.c
  86. +66 −117 kame/sys/netinet6/nd6.c
  87. +55 −55 kame/sys/netinet6/nd6.h
  88. +41 −60 kame/sys/netinet6/nd6_nbr.c
  89. +53 −86 kame/sys/netinet6/nd6_rtr.c
  90. +2 −2 kame/sys/netinet6/pim6_var.h
  91. +10 −23 kame/sys/netinet6/raw_ip6.c
  92. +10 −16 kame/sys/netinet6/route6.c
  93. +19 −31 kame/sys/netinet6/scope6.c
  94. +14 −14 kame/sys/netinet6/scope6_var.h
  95. +8 −19 kame/sys/netinet6/udp6_output.c
  96. +261 −447 kame/sys/netkey/key.c
  97. +35 −37 kame/sys/netkey/key.h
  98. +45 −68 kame/sys/netkey/key_debug.c
  99. +12 −12 kame/sys/netkey/key_debug.h
  100. +12 −20 kame/sys/netkey/keydb.c
  101. +13 −15 kame/sys/netkey/keydb.h
  102. +23 −48 kame/sys/netkey/keysock.c
  103. +8 −8 kame/sys/netkey/keysock.h
@@ -1,5 +1,5 @@
/* $NetBSD: blowfish.h,v 1.4 2001/09/09 11:01:01 tls Exp $ */
-/* $KAME: blowfish.h,v 1.14 2004/12/22 08:27:48 itojun Exp $ */
+/* $KAME: blowfish.h,v 1.15 2007/06/14 12:09:41 itojun Exp $ */
/* crypto/bf/blowfish.h */
/* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au)
@@ -80,13 +80,13 @@ typedef struct bf_key_st {
BF_LONG S[4*256];
} BF_KEY;
-void BF_set_key __P((BF_KEY *, int, const unsigned char *));
-void BF_encrypt __P((BF_LONG *, const BF_KEY *));
-void BF_decrypt __P((BF_LONG *, const BF_KEY *));
+void BF_set_key(BF_KEY *, int, const unsigned char *);
+void BF_encrypt(BF_LONG *, const BF_KEY *);
+void BF_decrypt(BF_LONG *, const BF_KEY *);
void BF_cbc_encrypt(const unsigned char *, unsigned char *, long,
- const BF_KEY *, unsigned char *, int);
+ const BF_KEY *, unsigned char *, int);
void BF_ecb_encrypt(const unsigned char *, unsigned char *,
- const BF_KEY *, int);
+ const BF_KEY *, int);
#ifdef __cplusplus
}
View
@@ -1,4 +1,4 @@
-/* $KAME: des.h,v 1.8 2001/09/10 04:03:57 itojun Exp $ */
+/* $KAME: des.h,v 1.9 2007/06/14 12:09:41 itojun Exp $ */
/* $NetBSD: des.h,v 1.5 2001/09/09 11:01:02 tls Exp $ */
/* lib/des/des.h */
@@ -59,13 +59,14 @@ extern "C" {
#define DES_LONG u_int32_t
typedef unsigned char des_cblock[8];
-typedef struct des_ks_struct
- {
+typedef struct des_ks_struct {
union {
- des_cblock cblock;
- /* make sure things are correct size on machines with
- * 8 byte longs */
- DES_LONG deslong[2];
+ des_cblock cblock;
+ /*
+ * make sure things are correct size on machines with
+ * 8 byte longs
+ */
+ DES_LONG deslong[2];
} ks;
int weak_key;
} des_key_schedule[16];
@@ -81,35 +82,35 @@ typedef struct des_ks_struct
extern int des_check_key; /* defaults to false */
-char *des_options __P((void));
-void des_ecb_encrypt __P((des_cblock *, des_cblock *,
- des_key_schedule, int));
+char *des_options(void);
+void des_ecb_encrypt(des_cblock *, des_cblock *,
+ des_key_schedule, int);
-void des_encrypt1 __P((DES_LONG *, des_key_schedule, int));
-void des_encrypt2 __P((DES_LONG *, des_key_schedule, int));
-void des_encrypt3 __P((DES_LONG *, des_key_schedule, des_key_schedule,
- des_key_schedule));
-void des_decrypt3 __P((DES_LONG *, des_key_schedule, des_key_schedule,
- des_key_schedule));
+void des_encrypt1(DES_LONG *, des_key_schedule, int);
+void des_encrypt2(DES_LONG *, des_key_schedule, int);
+void des_encrypt3(DES_LONG *, des_key_schedule, des_key_schedule,
+ des_key_schedule);
+void des_decrypt3(DES_LONG *, des_key_schedule, des_key_schedule,
+ des_key_schedule);
-void des_ecb3_encrypt __P((des_cblock *, des_cblock *, des_key_schedule,
- des_key_schedule, des_key_schedule, int));
+void des_ecb3_encrypt(des_cblock *, des_cblock *, des_key_schedule,
+ des_key_schedule, des_key_schedule, int);
-void des_ncbc_encrypt __P((const unsigned char *, unsigned char *, long,
- des_key_schedule, des_cblock *, int));
+void des_ncbc_encrypt(const unsigned char *, unsigned char *, long,
+ des_key_schedule, des_cblock *, int);
void des_ede3_cbc_encrypt(const unsigned char *, unsigned char *, long,
- des_key_schedule, des_key_schedule,
- des_key_schedule, des_cblock *, int);
-
-void des_set_odd_parity __P((des_cblock *));
-void des_fixup_key_parity __P((des_cblock *));
-int des_is_weak_key __P((des_cblock *));
-int des_set_key __P((des_cblock *, des_key_schedule));
-int des_key_sched __P((des_cblock *, des_key_schedule));
-int des_set_key_checked __P((des_cblock *, des_key_schedule));
-void des_set_key_unchecked __P((des_cblock *, des_key_schedule));
-int des_check_key_parity __P((des_cblock *));
+ des_key_schedule, des_key_schedule, des_key_schedule, des_cblock *,
+ int);
+
+void des_set_odd_parity(des_cblock *);
+void des_fixup_key_parity(des_cblock *);
+int des_is_weak_key(des_cblock *);
+int des_set_key(des_cblock *, des_key_schedule);
+int des_key_sched(des_cblock *, des_key_schedule);
+int des_set_key_checked(des_cblock *, des_key_schedule);
+void des_set_key_unchecked(des_cblock *, des_key_schedule);
+int des_check_key_parity(des_cblock *);
#ifdef __cplusplus
}
View
@@ -1,4 +1,4 @@
-/* $KAME: md5.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
+/* $KAME: md5.c,v 1.6 2007/06/14 12:09:41 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -130,11 +130,12 @@ static const u_int8_t md5_paddat[MD5_BUFLEN] = {
0, 0, 0, 0, 0, 0, 0, 0,
};
-static void md5_calc __P((u_int8_t *, md5_ctxt *));
+static void md5_calc(u_int8_t *, md5_ctxt *);
-void md5_init(ctxt)
- md5_ctxt *ctxt;
+void
+md5_init(md5_ctxt *ctxt)
{
+
ctxt->md5_n = 0;
ctxt->md5_i = 0;
ctxt->md5_sta = MD5_A0;
@@ -144,10 +145,9 @@ void md5_init(ctxt)
bzero(ctxt->md5_buf, sizeof(ctxt->md5_buf));
}
-void md5_loop(ctxt, input, len)
- md5_ctxt *ctxt;
- u_int8_t *input;
- u_int len; /* number of bytes */
+/* len - number of bytes */
+void
+md5_loop(md5_ctxt *ctxt, u_int8_t *input, u_int len)
{
u_int gap, i;
@@ -172,8 +172,8 @@ void md5_loop(ctxt, input, len)
}
}
-void md5_pad(ctxt)
- md5_ctxt *ctxt;
+void
+md5_pad(md5_ctxt *ctxt)
{
u_int gap;
@@ -211,10 +211,10 @@ void md5_pad(ctxt)
md5_calc(ctxt->md5_buf, ctxt);
}
-void md5_result(digest, ctxt)
- u_int8_t *digest;
- md5_ctxt *ctxt;
+void
+md5_result(u_int8_t *digest, md5_ctxt *ctxt)
{
+
/* 4 byte words */
#if BYTE_ORDER == LITTLE_ENDIAN
bcopy(&ctxt->md5_st8[0], digest, 16);
@@ -235,9 +235,8 @@ void md5_result(digest, ctxt)
u_int32_t X[16];
#endif
-static void md5_calc(b64, ctxt)
- u_int8_t *b64;
- md5_ctxt *ctxt;
+static void
+md5_calc(u_int8_t *b64, md5_ctxt *ctxt)
{
u_int32_t A = ctxt->md5_sta;
u_int32_t B = ctxt->md5_stb;
View
@@ -1,4 +1,4 @@
-/* $KAME: md5.h,v 1.5 2002/11/05 03:48:31 itojun Exp $ */
+/* $KAME: md5.h,v 1.6 2007/06/14 12:09:41 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -57,10 +57,10 @@ typedef struct {
u_int8_t md5_buf[MD5_BUFLEN];
} md5_ctxt;
-extern void md5_init __P((md5_ctxt *));
-extern void md5_loop __P((md5_ctxt *, u_int8_t *, u_int));
-extern void md5_pad __P((md5_ctxt *));
-extern void md5_result __P((u_int8_t *, md5_ctxt *));
+extern void md5_init(md5_ctxt *);
+extern void md5_loop(md5_ctxt *, u_int8_t *, u_int);
+extern void md5_pad(md5_ctxt *);
+extern void md5_result(u_int8_t *, md5_ctxt *);
/* compatibility */
#define MD5_CTX md5_ctxt
View
@@ -1,4 +1,4 @@
-/* $KAME: sha1.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
+/* $KAME: sha1.c,v 1.6 2007/06/14 12:09:41 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -87,11 +87,10 @@ static u_int32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
sha1_step(ctxt); \
}
-static void sha1_step __P((struct sha1_ctxt *));
+static void sha1_step(struct sha1_ctxt *);
static void
-sha1_step(ctxt)
- struct sha1_ctxt *ctxt;
+sha1_step(struct sha1_ctxt *ctxt)
{
u_int32_t a, b, c, d, e;
size_t t, s;
@@ -175,9 +174,9 @@ sha1_step(ctxt)
/*------------------------------------------------------------*/
void
-sha1_init(ctxt)
- struct sha1_ctxt *ctxt;
+sha1_init(struct sha1_ctxt *ctxt)
{
+
bzero(ctxt, sizeof(struct sha1_ctxt));
H(0) = 0x67452301;
H(1) = 0xefcdab89;
@@ -187,8 +186,7 @@ sha1_init(ctxt)
}
void
-sha1_pad(ctxt)
- struct sha1_ctxt *ctxt;
+sha1_pad(struct sha1_ctxt *ctxt)
{
size_t padlen; /*pad length in bytes*/
size_t padstart;
@@ -222,10 +220,7 @@ sha1_pad(ctxt)
}
void
-sha1_loop(ctxt, input0, len)
- struct sha1_ctxt *ctxt;
- const caddr_t input0;
- size_t len;
+sha1_loop(struct sha1_ctxt *ctxt, const caddr_t input0, size_t len)
{
const u_int8_t *input;
size_t gaplen;
@@ -252,9 +247,7 @@ sha1_loop(ctxt, input0, len)
}
void
-sha1_result(ctxt, digest0)
- struct sha1_ctxt *ctxt;
- caddr_t digest0;
+sha1_result(struct sha1_ctxt *ctxt, caddr_t digest0)
{
u_int8_t *digest;
View
@@ -1,4 +1,4 @@
-/* $KAME: sha1.h,v 1.5 2000/03/27 04:36:23 sumikawa Exp $ */
+/* $KAME: sha1.h,v 1.6 2007/06/14 12:09:41 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -54,10 +54,10 @@ struct sha1_ctxt {
};
#if defined(KERNEL) || defined(_KERNEL)
-extern void sha1_init __P((struct sha1_ctxt *));
-extern void sha1_pad __P((struct sha1_ctxt *));
-extern void sha1_loop __P((struct sha1_ctxt *, const caddr_t, size_t));
-extern void sha1_result __P((struct sha1_ctxt *, caddr_t));
+extern void sha1_init(struct sha1_ctxt *);
+extern void sha1_pad(struct sha1_ctxt *);
+extern void sha1_loop(struct sha1_ctxt *, const caddr_t, size_t);
+extern void sha1_result(struct sha1_ctxt *, caddr_t);
/* compatibilty with other SHA1 source codes */
typedef struct sha1_ctxt SHA1_CTX;
@@ -1,4 +1,4 @@
-/* $KAME: sha2.h,v 1.4 2003/07/20 00:28:38 itojun Exp $ */
+/* $KAME: sha2.h,v 1.5 2007/06/14 12:09:41 itojun Exp $ */
/*
* sha2.h
@@ -114,23 +114,23 @@ typedef SHA512_CTX SHA384_CTX;
/*** SHA-256/384/512 Function Prototypes ******************************/
-void SHA256_Init __P((SHA256_CTX *));
-void SHA256_Update __P((SHA256_CTX*, const u_int8_t*, size_t));
-void SHA256_Final __P((u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*));
-char* SHA256_End __P((SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]));
-char* SHA256_Data __P((const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]));
-
-void SHA384_Init __P((SHA384_CTX*));
-void SHA384_Update __P((SHA384_CTX*, const u_int8_t*, size_t));
-void SHA384_Final __P((u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*));
-char* SHA384_End __P((SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]));
-char* SHA384_Data __P((const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]));
-
-void SHA512_Init __P((SHA512_CTX*));
-void SHA512_Update __P((SHA512_CTX*, const u_int8_t*, size_t));
-void SHA512_Final __P((u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*));
-char* SHA512_End __P((SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]));
-char* SHA512_Data __P((const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]));
+void SHA256_Init(SHA256_CTX *);
+void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t);
+void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
+char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
+char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
+
+void SHA384_Init(SHA384_CTX*);
+void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t);
+void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
+char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
+char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
+
+void SHA512_Init(SHA512_CTX*);
+void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t);
+void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
+char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
+char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
#ifdef __cplusplus
}
Oops, something went wrong.

0 comments on commit f349701

Please sign in to comment.