Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit f349701ff749f7de15fe3033e92e0bd3c4387f95 1 parent 3ac8753
itojun authored
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
View
12 kame/sys/crypto/blowfish/blowfish.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
63 kame/sys/crypto/des/des.h
@@ -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
31 kame/sys/crypto/md5.c
@@ -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
10 kame/sys/crypto/md5.h
@@ -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
23 kame/sys/crypto/sha1.c
@@ -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
10 kame/sys/crypto/sha1.h
@@ -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;
View
36 kame/sys/crypto/sha2/sha2.h
@@ -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
}
View
155 kame/sys/crypto/twofish/twofish.h
@@ -71,80 +71,80 @@ INCLUDE IMPLEMENTATION SPECIFIC INFORMATION.
#define ROUND_SUBKEYS (OUTPUT_WHITEN + BLOCK_SIZE/32) /* use 2 * (# rounds) */
#define TOTAL_SUBKEYS (ROUND_SUBKEYS + 2*MAX_ROUNDS)
-/* Typedefs:
- Typedef'ed data storage elements. Add any algorithm specific
- parameters at the bottom of the structs as appropriate.
-*/
+/*
+ * Typedefs:
+ * Typedef'ed data storage elements. Add any algorithm specific
+ * parameters at the bottom of the structs as appropriate.
+ */
typedef u_int32_t fullSbox[4][256];
/* The structure for key information */
-typedef struct
- {
- u_int8_t direction; /* Key used for encrypting or decrypting? */
+typedef struct {
+ u_int8_t direction; /* Key used for encrypting or decrypting? */
#if ALIGN32
- u_int8_t dummyAlign[3]; /* keep 32-bit alignment */
+ u_int8_t dummyAlign[3]; /* keep 32-bit alignment */
#endif
- int keyLen; /* Length of the key */
+ int keyLen; /* Length of the key */
char keyMaterial[MAX_KEY_SIZE+4];/* Raw key data in ASCII */
/* Twofish-specific parameters: */
- u_int32_t keySig; /* set to VALID_SIG by makeKey() */
- int numRounds; /* number of rounds in cipher */
+ u_int32_t keySig; /* set to VALID_SIG by makeKey() */
+ int numRounds; /* number of rounds in cipher */
u_int32_t key32[MAX_KEY_BITS/32]; /* actual key bits, in dwords */
u_int32_t sboxKeys[MAX_KEY_BITS/64];/* key bits used for S-boxes */
u_int32_t subKeys[TOTAL_SUBKEYS]; /* round subkeys, input/output whitening bits */
#if REENTRANT
- fullSbox sBox8x32; /* fully expanded S-box */
+ fullSbox sBox8x32; /* fully expanded S-box */
#if defined(COMPILE_KEY) && defined(USE_ASM)
#undef VALID_SIG
-#define VALID_SIG 0x504D4F43 /* 'COMP': C is compiled with -DCOMPILE_KEY */
- u_int32_t cSig1; /* set after first "compile" (zero at "init") */
- void *encryptFuncPtr; /* ptr to asm encrypt function */
- void *decryptFuncPtr; /* ptr to asm decrypt function */
- u_int32_t codeSize; /* size of compiledCode */
- u_int32_t cSig2; /* set after first "compile" */
- u_int8_t compiledCode[5000]; /* make room for the code itself */
+#define VALID_SIG 0x504D4F43 /* 'COMP': C is compiled with -DCOMPILE_KEY */
+ u_int32_t cSig1; /* set after first "compile" (zero at "init") */
+ void *encryptFuncPtr; /* ptr to asm encrypt function */
+ void *decryptFuncPtr; /* ptr to asm decrypt function */
+ u_int32_t codeSize; /* size of compiledCode */
+ u_int32_t cSig2; /* set after first "compile" */
+ u_int8_t compiledCode[5000]; /* make room for the code itself */
#endif
#endif
- } keyInstance;
+} keyInstance;
/* The structure for cipher information */
-typedef struct
- {
- u_int8_t mode; /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
+typedef struct {
+ u_int8_t mode; /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
#if ALIGN32
- u_int8_t dummyAlign[3]; /* keep 32-bit alignment */
+ u_int8_t dummyAlign[3]; /* keep 32-bit alignment */
#endif
- u_int8_t IV[MAX_IV_SIZE]; /* CFB1 iv bytes (CBC uses iv32) */
+ u_int8_t IV[MAX_IV_SIZE]; /* CFB1 iv bytes (CBC uses iv32) */
/* Twofish-specific parameters: */
- u_int32_t cipherSig; /* set to VALID_SIG by cipherInit() */
- u_int32_t iv32[BLOCK_SIZE/32]; /* CBC IV bytes arranged as dwords */
- } cipherInstance;
+ u_int32_t cipherSig; /* set to VALID_SIG by cipherInit() */
+ u_int32_t iv32[BLOCK_SIZE/32]; /* CBC IV bytes arranged as dwords */
+} cipherInstance;
/* Function protoypes */
-int twofish_makeKey __P((keyInstance *, u_int8_t, int, char *));
+int twofish_makeKey(keyInstance *, u_int8_t, int, char *);
-int twofish_cipherInit __P((cipherInstance *, u_int8_t, char *));
+int twofish_cipherInit(cipherInstance *, u_int8_t, char *);
-int twofish_blockEncrypt __P((cipherInstance *, keyInstance *, u_int8_t *,
- int, u_int8_t *));
+int twofish_blockEncrypt(cipherInstance *, keyInstance *, u_int8_t *,
+ int, u_int8_t *);
-int twofish_blockDecrypt __P((cipherInstance *, keyInstance *, u_int8_t *,
- int, u_int8_t *));
+int twofish_blockDecrypt(cipherInstance *, keyInstance *, u_int8_t *,
+ int, u_int8_t *);
-int twofish_reKey __P((keyInstance *)); /* do key schedule using modified key.keyDwords */
+/* do key schedule using modified key.keyDwords */
+int twofish_reKey(keyInstance *);
/* API to check table usage, for use in ECB_TBL KAT */
-#define TAB_DISABLE 0
-#define TAB_ENABLE 1
-#define TAB_RESET 2
-#define TAB_QUERY 3
+#define TAB_DISABLE 0
+#define TAB_ENABLE 1
+#define TAB_RESET 2
+#define TAB_QUERY 3
#define TAB_MIN_QUERY 50
int twofish_TableOp(int op);
-#define CONST /* helpful C++ syntax sugar, NOP for ANSI C */
+#define CONST /* helpful C++ syntax sugar, NOP for ANSI C */
#if BLOCK_SIZE == 128 /* optimize block copies */
#define Copy1(d,s,N) ((u_int32_t *)(d))[N] = ((u_int32_t *)(s))[N]
@@ -195,71 +195,74 @@ to run the test on the pedagogical code.
#include <string.h>
#define MAX_BLK_CNT 4 /* max # blocks per call in TestTwofish */
-int TestTwofish(int mode,int keySize) /* keySize must be 128, 192, or 256 */
- { /* return 0 iff test passes */
- keyInstance ki; /* key information, including tables */
- cipherInstance ci; /* keeps mode (ECB, CBC) and IV */
- u_int8_t plainText[MAX_BLK_CNT*(BLOCK_SIZE/8)];
- u_int8_t cipherText[MAX_BLK_CNT*(BLOCK_SIZE/8)];
- u_int8_t decryptOut[MAX_BLK_CNT*(BLOCK_SIZE/8)];
- u_int8_t iv[BLOCK_SIZE/8];
- int i,byteCnt;
-
- if (makeKey(&ki,DIR_ENCRYPT,keySize,NULL) != TRUE)
+int TestTwofish(int mode, int keySize) /* keySize must be 128, 192, or 256 */
+{ /* return 0 iff test passes */
+ keyInstance ki; /* key information, including tables */
+ cipherInstance ci; /* keeps mode (ECB, CBC) and IV */
+ u_int8_t plainText[MAX_BLK_CNT * (BLOCK_SIZE / 8)];
+ u_int8_t cipherText[MAX_BLK_CNT * (BLOCK_SIZE / 8)];
+ u_int8_t decryptOut[MAX_BLK_CNT * (BLOCK_SIZE / 8)];
+ u_int8_t iv[BLOCK_SIZE / 8];
+ int i, byteCnt;
+
+ if (makeKey(&ki, DIR_ENCRYPT, keySize, NULL) != TRUE)
return 1; /* 'dummy' setup for a 128-bit key */
- if (cipherInit(&ci,mode,NULL) != TRUE)
+ if (cipherInit(&ci, mode, NULL) != TRUE)
return 1; /* 'dummy' setup for cipher */
- for (i=0;i<keySize/32;i++) /* select key bits */
- ki.key32[i]=0x10003 * rand();
+ for (i = 0; i < keySize / 32; i++) /* select key bits */
+ ki.key32[i] = 0x10003 * rand();
reKey(&ki); /* run the key schedule */
- if (mode != MODE_ECB) /* set up random iv (if needed)*/
- {
- for (i=0;i<sizeof(iv);i++)
+ if (mode != MODE_ECB) { /* set up random iv (if needed)*/
+ for (i = 0; i < sizeof(iv); i++)
iv[i]=(u_int8_t) rand();
- memcpy(ci.iv32,iv,sizeof(ci.iv32)); /* copy the IV to ci */
- }
+ memcpy(ci.iv32, iv, sizeof(ci.iv32)); /* copy the IV to ci */
+ }
/* select number of bytes to encrypt (multiple of block) */
/* e.g., byteCnt = 16, 32, 48, 64 */
- byteCnt = (BLOCK_SIZE/8) * (1 + (rand() % MAX_BLK_CNT));
+ byteCnt = (BLOCK_SIZE / 8) * (1 + (rand() % MAX_BLK_CNT));
- for (i=0;i<byteCnt;i++) /* generate test data */
+ for (i = 0; i < byteCnt; i++) /* generate test data */
plainText[i]=(u_int8_t) rand();
/* encrypt the bytes */
- if (blockEncrypt(&ci,&ki, plainText,byteCnt*8,cipherText) != byteCnt*8)
+ if (blockEncrypt(&ci,& ki, plainText, byteCnt * 8, cipherText) != byteCnt*8)
return 1;
/* decrypt the bytes */
if (mode != MODE_ECB) /* first re-init the IV (if needed) */
- memcpy(ci.iv32,iv,sizeof(ci.iv32));
+ memcpy(ci.iv32, iv, sizeof(ci.iv32));
- if (blockDecrypt(&ci,&ki,cipherText,byteCnt*8,decryptOut) != byteCnt*8)
+ if (blockDecrypt(&ci, &ki, cipherText, byteCnt * 8, decryptOut) != byteCnt*8)
return 1;
/* make sure the decrypt output matches original plaintext */
- if (memcmp(plainText,decryptOut,byteCnt))
+ if (memcmp(plainText, decryptOut, byteCnt))
return 1;
return 0; /* tests passed! */
- }
+}
void main(void)
- {
- int testCnt,keySize;
+{
+ int testCnt, keySize;
srand((unsigned) time(NULL)); /* randomize */
- for (keySize=128;keySize<=256;keySize+=64)
- for (testCnt=0;testCnt<10;testCnt++)
- {
- if (TestTwofish(MODE_ECB,keySize))
- { printf("ECB Failure at keySize=%d",keySize); return; }
- if (TestTwofish(MODE_CBC,keySize))
- { printf("CBC Failure at keySize=%d",keySize); return; }
+ for (keySize = 128; keySize <= 256; keySize += 64) {
+ for (testCnt = 0; testCnt < 10; testCnt++) {
+ if (TestTwofish(MODE_ECB, keySize)) {
+ printf("ECB Failure at keySize=%d", keySize);
+ return;
}
- printf("Tests passed");
+ if (TestTwofish(MODE_CBC, keySize)) {
+ printf("CBC Failure at keySize=%d", keySize);
+ return;
+ }
+ }
}
+ printf("Tests passed");
+}
#endif /* TEST_2FISH */
View
10 kame/sys/crypto/twofish/twofish2.c
@@ -46,10 +46,10 @@
#include <crypto/twofish/twofish.h>
#include <crypto/twofish/table.h>
-static int ParseHexDword __P((int, CONST char *, DWORD *, char *));
-static DWORD RS_MDS_Encode __P((DWORD, DWORD));
-static void BuildMDS __P((void));
-static void ReverseRoundSubkeys __P((keyInstance *, BYTE));
+static int ParseHexDword(int, CONST char *, DWORD *, char *);
+static DWORD RS_MDS_Encode(DWORD, DWORD);
+static void BuildMDS(void);
+static void ReverseRoundSubkeys(keyInstance *, BYTE);
#if defined(min_key) && !defined(MIN_KEY)
#define MIN_KEY 1 /* toupper() */
@@ -539,7 +539,7 @@ static void ReverseRoundSubkeys(keyInstance *key,BYTE newDir)
{ Xor32(dst,src,i ); Xor32(dst,src,i+1); Xor32(dst,src,i+2); Xor32(dst,src,i+3); } \
}
#else /* do it as a function call */
-static void Xor256 __P((void *, void *, BYTE));
+static void Xor256(void *, void *, BYTE);
static void Xor256(void *dst,void *src,BYTE b)
{
View
62 kame/sys/kern/uipc_mbuf2.c
@@ -1,4 +1,4 @@
-/* $KAME: uipc_mbuf2.c,v 1.49 2007/02/23 18:09:54 itojun Exp $ */
+/* $KAME: uipc_mbuf2.c,v 1.50 2007/06/14 12:09:42 itojun Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */
/*
@@ -83,7 +83,7 @@
#ifdef __FreeBSD__
/* can't call it m_dup(), as freebsd[34] uses m_dup() with different arg */
-static struct mbuf *m_dup1 __P((struct mbuf *, int, int, int));
+static struct mbuf *m_dup1(struct mbuf *, int, int, int);
#endif
#ifdef __FreeBSD__
@@ -105,10 +105,7 @@ MALLOC_DEFINE(M_PACKET_TAGS, "packet tags", "Packet-attached information");
* XXX M_TRAILINGSPACE/M_LEADINGSPACE on shared cluster (sharedcluster)
*/
struct mbuf *
-m_pulldown(m, off, len, offp)
- struct mbuf *m;
- int off, len;
- int *offp;
+m_pulldown(struct mbuf *m, int off, int len, int *offp)
{
struct mbuf *n, *o;
int hlen, tlen, olen;
@@ -354,11 +351,7 @@ m_pulldown(m, off, len, offp)
#ifdef __FreeBSD__
static struct mbuf *
-m_dup1(m, off, len, wait)
- struct mbuf *m;
- int off;
- int len;
- int wait;
+m_dup1(struct mbuf *m, int off, int len, int wait)
{
struct mbuf *n;
int l;
@@ -400,10 +393,7 @@ m_dup1(m, off, len, wait)
/* Get a packet tag structure along with specified data following. */
struct m_tag *
-m_tag_get(type, len, wait)
- int type;
- int len;
- int wait;
+m_tag_get(int type, int len, int wait)
{
struct m_tag *t;
@@ -419,8 +409,7 @@ m_tag_get(type, len, wait)
/* Free a packet tag. */
void
-m_tag_free(t)
- struct m_tag *t;
+m_tag_free(struct m_tag *t)
{
#ifdef __FreeBSD__
@@ -434,9 +423,7 @@ m_tag_free(t)
/* Prepend a packet tag. */
void
-m_tag_prepend(m, t)
- struct mbuf *m;
- struct m_tag *t;
+m_tag_prepend(struct mbuf *m, struct m_tag *t)
{
SLIST_INSERT_HEAD(&m->m_pkthdr.tags, t, m_tag_link);
@@ -444,9 +431,7 @@ m_tag_prepend(m, t)
/* Unlink a packet tag. */
void
-m_tag_unlink(m, t)
- struct mbuf *m;
- struct m_tag *t;
+m_tag_unlink(struct mbuf *m, struct m_tag *t)
{
SLIST_REMOVE(&m->m_pkthdr.tags, t, m_tag, m_tag_link);
@@ -454,9 +439,7 @@ m_tag_unlink(m, t)
/* Unlink and free a packet tag. */
void
-m_tag_delete(m, t)
- struct mbuf *m;
- struct m_tag *t;
+m_tag_delete(struct mbuf *m, struct m_tag *t)
{
m_tag_unlink(m, t);
@@ -465,9 +448,7 @@ m_tag_delete(m, t)
/* Unlink and free a packet tag chain, starting from given tag. */
void
-m_tag_delete_chain(m, t)
- struct mbuf *m;
- struct m_tag *t;
+m_tag_delete_chain(struct mbuf *m, struct m_tag *t)
{
struct m_tag *p, *q;
@@ -493,6 +474,7 @@ m_tag_delete_chain(m, t)
void
m_tag_delete_nonpersistent(struct mbuf *m)
{
+
/* NetBSD has no persistent tags yet, so just delete all tags. */
return m_tag_delete_chain(m, NULL);
}
@@ -500,10 +482,7 @@ m_tag_delete_nonpersistent(struct mbuf *m)
/* Find a tag, starting from a given position. */
struct m_tag *
-m_tag_find(m, type, t)
- struct mbuf *m;
- int type;
- struct m_tag *t;
+m_tag_find(struct mbuf *m, int type, struct m_tag *t)
{
struct m_tag *p;
@@ -521,8 +500,7 @@ m_tag_find(m, type, t)
/* Copy a single tag. */
struct m_tag *
-m_tag_copy(t)
- struct m_tag *t;
+m_tag_copy(struct m_tag *t)
{
struct m_tag *p;
@@ -558,9 +536,7 @@ m_tag_copy(t)
* destination mbuf.
*/
int
-m_tag_copy_chain(to, from)
- struct mbuf *to;
- struct mbuf *from;
+m_tag_copy_chain(struct mbuf *to, struct mbuf *from)
{
struct m_tag *p, *t, *tprev = NULL;
@@ -582,8 +558,7 @@ m_tag_copy_chain(to, from)
/* Initialize tags on an mbuf. */
void
-m_tag_init(m)
- struct mbuf *m;
+m_tag_init(struct mbuf *m)
{
SLIST_INIT(&m->m_pkthdr.tags);
@@ -591,8 +566,7 @@ m_tag_init(m)
/* Get first tag in chain. */
struct m_tag *
-m_tag_first(m)
- struct mbuf *m;
+m_tag_first(struct mbuf *m)
{
return (SLIST_FIRST(&m->m_pkthdr.tags));
@@ -600,9 +574,7 @@ m_tag_first(m)
/* Get next tag in chain. */
struct m_tag *
-m_tag_next(m, t)
- struct mbuf *m;
- struct m_tag *t;
+m_tag_next(struct mbuf *m, struct m_tag *t)
{
return (SLIST_NEXT(t, m_tag_link));
View
43 kame/sys/net/if_dummy.c
@@ -1,4 +1,4 @@
-/* $KAME: if_dummy.c,v 1.29 2005/04/14 06:22:37 suz Exp $ */
+/* $KAME: if_dummy.c,v 1.30 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -115,16 +115,16 @@
#include <net/net_osdep.h>
-static int dummyioctl __P((struct ifnet *, u_long, caddr_t));
-int dummyoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
-static void dummyrtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
+static int dummyioctl(struct ifnet *, u_long, caddr_t);
+int dummyoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
+static void dummyrtrequest(int, struct rtentry *, struct rt_addrinfo *);
#ifdef __FreeBSD__
-void dummyattach __P((void *));
+void dummyattach(void *);
PSEUDO_SET(dummyattach, if_dummy);
#else
-void dummyattach __P((int));
+void dummyattach(int);
#endif
#ifdef TINY_DUMMYMTU
@@ -137,11 +137,10 @@ static struct ifnet dummyif[NDUMMY];
/* ARGSUSED */
void
-dummyattach(dummy)
#ifdef __FreeBSD__
- void *dummy;
+dummyattach(void *dummy)
#else
- int dummy;
+dummyattach(int dummy)
#endif
{
struct ifnet *ifp;
@@ -175,20 +174,17 @@ dummyattach(dummy)
#endif
#if NBPFILTER > 0
#ifdef HAVE_NEW_BPFATTACH
- bpfattach(ifp, DLT_NULL, sizeof(u_int));
+ bpfattach(ifp, DLT_NULL, sizeof(u_int);
#else
- bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int));
+ bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int);
#endif
#endif
}
}
int
-dummyoutput(ifp, m, dst, rt)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct rtentry *rt;
+dummyoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
{
#ifndef __FreeBSD__
int s;
@@ -201,7 +197,7 @@ dummyoutput(ifp, m, dst, rt)
#if NBPFILTER > 0
/* BPF write needs to be handled specially */
if (dst->sa_family == AF_UNSPEC) {
- dst->sa_family = *(mtod(m, int *));
+ dst->sa_family = *mtod(m, int *);
m->m_len -= sizeof(int);
m->m_pkthdr.len -= sizeof(int);
m->m_data += sizeof(int);
@@ -324,11 +320,9 @@ dummyoutput(ifp, m, dst, rt)
/* ARGSUSED */
static void
-dummyrtrequest(cmd, rt, info)
- int cmd;
- struct rtentry *rt;
- struct rt_addrinfo *info;
+dummyrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
{
+
if (rt) {
rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
}
@@ -339,10 +333,7 @@ dummyrtrequest(cmd, rt, info)
*/
/* ARGSUSED */
static int
-dummyioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+dummyioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct ifaddr *ifa;
struct ifreq *ifr = (struct ifreq *)data;
View
40 kame/sys/net/if_faith.c
@@ -1,4 +1,4 @@
-/* $KAME: if_faith.c,v 1.41 2005/04/14 06:22:37 suz Exp $ */
+/* $KAME: if_faith.c,v 1.42 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -108,16 +108,16 @@
#include <net/net_osdep.h>
-static int faithioctl __P((struct ifnet *, u_long, caddr_t));
-int faithoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
-static void faithrtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
+static int faithioctl(struct ifnet *, u_long, caddr_t);
+int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
+static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
#ifdef __FreeBSD__
-void faithattach __P((void *));
+void faithattach(void *);
PSEUDO_SET(faithattach, if_faith);
#else
-void faithattach __P((int));
+void faithattach(int);
#endif
static struct ifnet faithif[NFAITH];
@@ -126,11 +126,10 @@ static struct ifnet faithif[NFAITH];
/* ARGSUSED */
void
-faithattach(faith)
#ifdef __FreeBSD__
- void *faith;
+faithattach(void *faith)
#else
- int faith;
+faithattach(int faith)
#endif
{
struct ifnet *ifp;
@@ -173,11 +172,8 @@ faithattach(faith)
}
int
-faithoutput(ifp, m, dst, rt)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct rtentry *rt;
+faithoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
{
#ifndef __FreeBSD__
int s;
@@ -281,11 +277,9 @@ faithoutput(ifp, m, dst, rt)
/* ARGSUSED */
static void
-faithrtrequest(cmd, rt, info)
- int cmd;
- struct rtentry *rt;
- struct rt_addrinfo *info;
+faithrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
{
+
if (rt) {
rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; /* for ISO */
}
@@ -296,10 +290,7 @@ faithrtrequest(cmd, rt, info)
*/
/* ARGSUSED */
static int
-faithioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+faithioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct ifaddr *ifa;
struct ifreq *ifr = (struct ifreq *)data;
@@ -359,8 +350,7 @@ faithioctl(ifp, cmd, data)
* XXX could be layer violation to call sys/net from sys/netinet6
*/
int
-faithprefix(in6)
- struct in6_addr *in6;
+faithprefix(struct in6_addr *in6)
{
struct rtentry *rt;
struct sockaddr_in6 sin6;
View
4 kame/sys/net/if_faith.h
@@ -1,4 +1,4 @@
-/* $KAME: if_faith.h,v 1.5 2002/10/08 07:18:09 itojun Exp $ */
+/* $KAME: if_faith.h,v 1.6 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 2000 WIDE Project.
@@ -34,7 +34,7 @@
#ifdef _KERNEL
struct in6_addr;
-int faithprefix __P((struct in6_addr *));
+int faithprefix(struct in6_addr *);
#endif
#endif /* _NET_IF_FAITH_H_ */
View
58 kame/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $KAME: if_gif.c,v 1.117 2007/02/21 02:44:12 keiichi Exp $ */
+/* $KAME: if_gif.c,v 1.118 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -118,14 +118,14 @@
struct gif_softc_list gif_softc_list;
#ifdef __FreeBSD__
-void gifattach __P((void *));
+void gifattach(void *);
#else
-void gifattach __P((int));
+void gifattach(int);
#endif
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
-void gifnetisr __P((void));
+void gifnetisr(void);
#endif
-void gifintr __P((void *));
+void gifintr(void *);
#if defined(__NetBSD__) && defined(ISO)
static struct mbuf *gif_eon_encap(struct mbuf *);
static struct mbuf *gif_eon_decap(struct ifnet *, struct mbuf *);
@@ -138,11 +138,10 @@ int ngif; /* number of interfaces */
struct gif_softc *gif_softc = NULL;
void
-gifattach(dummy)
#ifdef __FreeBSD__
- void *dummy;
+gifattach(void *dummy)
#else
- int dummy;
+gifattach(int dummy)
#endif
{
struct gif_softc *sc;
@@ -171,8 +170,7 @@ gifattach(dummy)
}
void
-gifattach0(sc)
- struct gif_softc *sc;
+gifattach0(struct gif_softc *sc)
{
sc->encap_cookie4 = sc->encap_cookie6 = NULL;
@@ -217,8 +215,7 @@ PSEUDO_SET(gifattach, if_gif);
#ifdef __OpenBSD__
void
-gif_start(ifp)
- struct ifnet *ifp;
+gif_start(struct ifnet *ifp)
{
#if NBRIDGE > 0
struct sockaddr dst;
@@ -262,11 +259,7 @@ gif_start(ifp)
#ifdef GIF_ENCAPCHECK
int
-gif_encapcheck(m, off, proto, arg)
- const struct mbuf *m;
- int off;
- int proto;
- void *arg;
+gif_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
{
struct ip ip;
struct gif_softc *sc;
@@ -329,12 +322,10 @@ gif_encapcheck(m, off, proto, arg)
}
#endif
+/* rt - added in net2 */
int
-gif_output(ifp, m, dst, rt)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct rtentry *rt; /* added in net2 */
+gif_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
{
struct gif_softc *sc = (struct gif_softc*)ifp;
int error = 0;
@@ -447,7 +438,7 @@ gif_output(ifp, m, dst, rt)
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
void
-gifnetisr()
+gifnetisr(void)
{
struct gif_softc *sc;
@@ -459,8 +450,7 @@ gifnetisr()
#endif
void
-gifintr(arg)
- void *arg;
+gifintr(void *arg)
{
struct gif_softc *sc;
struct ifnet *ifp;
@@ -532,10 +522,7 @@ gifintr(arg)
#ifndef __OpenBSD__ /* on openbsd, ipip_input() does it instead */
void
-gif_input(m, af, ifp)
- struct mbuf *m;
- int af;
- struct ifnet *ifp;
+gif_input(struct mbuf *m, int af, struct ifnet *ifp)
{
#ifndef __FreeBSD__
int s;
@@ -652,10 +639,7 @@ gif_input(m, af, ifp)
/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
int
-gif_ioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct gif_softc *sc = (struct gif_softc*)ifp;
struct ifreq *ifr = (struct ifreq*)data;
@@ -918,10 +902,7 @@ gif_ioctl(ifp, cmd, data)
}
int
-gif_set_tunnel(ifp, src, dst)
- struct ifnet *ifp;
- struct sockaddr *src;
- struct sockaddr *dst;
+gif_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
{
struct gif_softc *sc = (struct gif_softc *)ifp;
struct gif_softc *sc2;
@@ -1054,8 +1035,7 @@ gif_set_tunnel(ifp, src, dst)
}
void
-gif_delete_tunnel(ifp)
- struct ifnet *ifp;
+gif_delete_tunnel(struct ifnet *ifp)
{
struct gif_softc *sc = (struct gif_softc *)ifp;
int s;
View
20 kame/sys/net/if_gif.h
@@ -1,4 +1,4 @@
-/* $KAME: if_gif.h,v 1.39 2005/04/14 06:22:37 suz Exp $ */
+/* $KAME: if_gif.h,v 1.40 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -105,20 +105,20 @@ extern struct gif_softc *gif_softc;
extern LIST_HEAD(gif_softc_list, gif_softc) gif_softc_list;
/* Prototypes */
-void gifattach0 __P((struct gif_softc *));
+void gifattach0(struct gif_softc *)
#ifndef __OpenBSD__
-void gif_input __P((struct mbuf *, int, struct ifnet *));
+void gif_input(struct mbuf *, int, struct ifnet *)
#endif
-int gif_output __P((struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *));
-int gif_ioctl __P((struct ifnet *, u_long, caddr_t));
-int gif_set_tunnel __P((struct ifnet *, struct sockaddr *, struct sockaddr *));
-void gif_delete_tunnel __P((struct ifnet *));
+int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *)
+int gif_ioctl(struct ifnet *, u_long, caddr_t)
+int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *)
+void gif_delete_tunnel(struct ifnet *)
#ifdef __OpenBSD__
-void gif_start __P((struct ifnet *));
+void gif_start(struct ifnet *)
#endif
#ifdef GIF_ENCAPCHECK
-int gif_encapcheck __P((const struct mbuf *, int, int, void *));
+int gif_encapcheck(const struct mbuf *, int, int, void *)
#endif
#endif /* _NET_IF_GIF_H_ */
View
69 kame/sys/net/if_ist.c
@@ -1,4 +1,4 @@
-/* $KAME: if_ist.c,v 1.10 2005/10/20 07:57:57 kei Exp $ */
+/* $KAME: if_ist.c,v 1.11 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 2000 WIDE Project.
@@ -182,11 +182,10 @@ int fill_isatap_rtrlist(void *, size_t *, size_t);
#endif
void
-istattach(dummy)
#ifdef __FreeBSD__
- void *dummy;
+istattach(void *dummy)
#else
- int dummy;
+istattach(int dummy)
#endif
{
struct ist_softc *sc;
@@ -261,11 +260,7 @@ PSEUDO_SET(istattach, if_ist);
#endif
static int
-ist_encapcheck(m, off, proto, arg)
- const struct mbuf *m;
- int off;
- int proto;
- void *arg;
+ist_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
{
struct ip ip;
struct in6_ifaddr *ia6;
@@ -319,8 +314,7 @@ ist_encapcheck(m, off, proto, arg)
}
static struct in6_ifaddr *
-ist_getsrcifa6(ifp)
- struct ifnet *ifp;
+ist_getsrcifa6(struct ifnet *ifp)
{
struct ifaddr *ia;
struct in_ifaddr *ia4;
@@ -373,9 +367,7 @@ ist_getsrcifa6(ifp)
}
static int
-isatap_match_prefix(ifp, addr6)
- struct ifnet *ifp;
- struct in6_addr *addr6;
+isatap_match_prefix(struct ifnet *ifp, struct in6_addr *addr6)
{
struct ifaddr *ia;
struct in6_ifaddr *ia6;
@@ -407,11 +399,8 @@ isatap_match_prefix(ifp, addr6)
#endif
static int
-ist_output(ifp, m, dst, rt)
-struct ifnet *ifp;
-struct mbuf *m;
-struct sockaddr *dst;
-struct rtentry *rt;
+ist_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
{
#ifdef __OpenBSD__
struct ist_softc *sc;
@@ -705,11 +694,10 @@ struct rtentry *rt;
#endif
}
+/* inifp - incoming interface */
static int
-ist_checkaddr4(sc, in, inifp)
- struct ist_softc *sc;
- struct in_addr *in;
- struct ifnet *inifp; /* incoming interface */
+ist_checkaddr4(struct ist_softc *sc, struct in_addr *in, struct ifnet *inifp)
+ struct ifnet *inifp;
{
struct in_ifaddr *ia4;
@@ -782,11 +770,9 @@ ist_checkaddr4(sc, in, inifp)
return 0;
}
+/* inifp - incoming interface */
static int
-ist_checkaddr6(sc, in6, inifp)
- struct ist_softc *sc;
- struct in6_addr *in6;
- struct ifnet *inifp; /* incoming interface */
+ist_checkaddr6(struct ist_softc *sc, struct in6_addr *in6, struct ifnet *inifp)
{
/*
@@ -824,10 +810,7 @@ ist_checkaddr6(sc, in6, inifp)
* you must check the validity of each address by stf_checkaddr[46] in advance.
*/
static int
-ist_checkaddr46(sc, in, in6)
- struct ist_softc *sc;
- struct in_addr *in;
- struct in6_addr *in6;
+ist_checkaddr46(struct ist_softc *sc, struct in_addr *in, struct in6_addr *in6)
{
struct isatap_rtr *rtr;
@@ -856,15 +839,12 @@ ist_checkaddr46(sc, in, in6)
void
#ifdef __FreeBSD__
-in_ist_input(m, off)
- struct mbuf *m;
- int off;
+in_ist_input(struct mbuf *m, int off)
#else
#if __STDC__
in_ist_input(struct mbuf *m, ...)
#else
-in_ist_input(m, va_alist)
- struct mbuf *m;
+in_ist_input(struct mbuf *m, va_alist)
#endif
#endif /* __FreeBSD__ */
{
@@ -1020,10 +1000,7 @@ in_ist_input(m, va_alist)
/* ARGSUSED */
static void
-ist_rtrequest(cmd, rt, info)
- int cmd;
- struct rtentry *rt;
- struct rt_addrinfo *info;
+ist_rtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
{
if (rt)
@@ -1031,10 +1008,7 @@ ist_rtrequest(cmd, rt, info)
}
static int
-ist_ioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+ist_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
#if defined(__NetBSD__) || defined(__OpenBSD__)
struct proc *p = curproc; /* XXX */
@@ -1198,13 +1172,10 @@ ist_sysctl_isatap_rtrlist(SYSCTLFN_ARGS)
#ifndef __FreeBSD__
int
-fill_isatap_rtrlist(oldp, oldlenp, ol)
- void *oldp;
- size_t *oldlenp, ol;
+fill_isatap_rtrlist(void *oldp, size_t *oldlenp, size_t ol)
#else
static int
-fill_isatap_rtrlist(req)
- struct sysctl_req *req;
+fill_isatap_rtrlist(struct sysctl_req *req)
#endif
{
int error = 0;
View
46 kame/sys/net/if_mip.c
@@ -1,4 +1,4 @@
-/* $KAME: if_mip.c,v 1.11 2007/03/30 09:41:15 keiichi Exp $ */
+/* $KAME: if_mip.c,v 1.12 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 2004 WIDE Project.
@@ -106,11 +106,10 @@ PSEUDO_SET(mipattach, if_mip);
#endif
void
-mipattach(dummy)
#ifdef __FreeBSD__
- void *dummy;
+mipattach(void *dummy)
#else
- int dummy;
+mipattach(int dummy)
#endif
{
struct mip_softc *sc;
@@ -191,21 +190,12 @@ mipattach(dummy)
#ifndef __APPLE__
int
-mip_output(ifp, m, dst, rt)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct rtentry *rt;
+mip_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
#else
int
-mip_pre_output(
- struct ifnet *ifp,
- u_long protocol_family,
- struct mbuf **m0,
- const struct sockaddr *dst,
- caddr_t rt0,
- char *frame,
- char *address)
+mip_pre_output(struct ifnet *ifp, u_long protocol_family, struct mbuf **m0,
+ const struct sockaddr *dst, caddr_t rt0, char *frame, char *address)
#endif /* __APPLE__ */
{
int error = 0;
@@ -375,10 +365,7 @@ mip_pre_output(
}
int
-mip_ioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+mip_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
int s, error;
struct ifreq *ifr = (struct ifreq *)data;
@@ -481,8 +468,7 @@ mip_ioctl(ifp, cmd, data)
}
int
-mip_is_mip_softc(ifp)
- struct ifnet *ifp;
+mip_is_mip_softc(struct ifnet *ifp)
{
struct mip_softc *mipsc;
@@ -496,11 +482,8 @@ mip_is_mip_softc(ifp)
#ifdef __APPLE__
int
-mip_demux(
- struct ifnet *ifp,
- struct mbuf *m,
- char *frame_header,
- u_long *protocol_family)
+mip_demux(struct ifnet *ifp, struct mbuf *m, char *frame_header,
+ u_long *protocol_family)
{
struct mip_softc* mip = (struct mip_softc*)ifp->if_softc;
@@ -511,7 +494,8 @@ mip_demux(
}
static int
-mip_add_proto(struct ifnet *ifp, u_long protocol_family, struct ddesc_head_str *desc_head)
+mip_add_proto(struct ifnet *ifp, u_long protocol_family,
+ struct ddesc_head_str *desc_head)
{
/* Only one protocol may be attached at a time */
struct mip_softc* mip = (struct mip_softc*)ifp->if_softc;
@@ -537,9 +521,7 @@ mip_del_proto(struct ifnet *ifp, u_long protocol_family)
/* Glue code to attach inet to a gif interface through DLIL */
int
-mip_attach_proto_family(
- struct ifnet *ifp,
- u_long protocol_family)
+mip_attach_proto_family(struct ifnet *ifp, u_long protocol_family)
{
struct dlil_proto_reg_str reg;
int stat;
View
58 kame/sys/net/if_nemo.c
@@ -1,4 +1,4 @@
-/* $KAME: if_nemo.c,v 1.8 2005/07/23 07:41:27 jinmei Exp $ */
+/* $KAME: if_nemo.c,v 1.9 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -113,14 +113,14 @@
LIST_HEAD(, nemo_softc) nemo_softc_list;
#ifdef __FreeBSD__
-void nemoattach __P((void *));
+void nemoattach(void *);
#else
-void nemoattach __P((int));
+void nemoattach(int);
#endif
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
-void nemonetisr __P((void));
+void nemonetisr(void);
#endif
-void nemointr __P((void *));
+void nemointr(void *);
#if defined(__NetBSD__) && defined(ISO)
static struct mbuf *nemo_eon_encap(struct mbuf *);
static struct mbuf *nemo_eon_decap(struct ifnet *, struct mbuf *);
@@ -133,11 +133,10 @@ int nnemo; /* number of interfaces */
struct nemo_softc *nemo_softc = NULL;
void
-nemoattach(dummy)
#ifdef __FreeBSD__
- void *dummy;
+nemoattach(void *dummy)
#else
- int dummy;
+nemoattach(int dummy)
#endif
{
struct nemo_softc *sc;
@@ -166,8 +165,7 @@ nemoattach(dummy)
}
void
-nemoattach0(sc)
- struct nemo_softc *sc;
+nemoattach0(struct nemo_softc *sc)
{
sc->encap_cookie4 = sc->encap_cookie6 = NULL;
@@ -212,8 +210,7 @@ PSEUDO_SET(nemoattach, if_nemo);
#ifdef __OpenBSD__
void
-nemo_start(ifp)
- struct ifnet *ifp;
+nemo_start(struct ifnet *ifp)
{
#if NBRIDGE > 0
struct sockaddr dst;
@@ -257,11 +254,7 @@ nemo_start(ifp)
#ifdef GIF_ENCAPCHECK
int
-nemo_encapcheck(m, off, proto, arg)
- const struct mbuf *m;
- int off;
- int proto;
- void *arg;
+nemo_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
{
struct ip ip;
struct nemo_softc *sc;
@@ -324,12 +317,10 @@ nemo_encapcheck(m, off, proto, arg)
}
#endif
+/* rt - added in net2 */
int
-nemo_output(ifp, m, dst, rt)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct rtentry *rt; /* added in net2 */
+nemo_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
{
struct nemo_softc *sc = (struct nemo_softc*)ifp;
int error = 0;
@@ -434,7 +425,7 @@ nemo_output(ifp, m, dst, rt)
#ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
void
-nemonetisr()
+nemonetisr(void)
{
struct nemo_softc *sc;
@@ -446,8 +437,7 @@ nemonetisr()
#endif
void
-nemointr(arg)
- void *arg;
+nemointr(void *arg)
{
struct nemo_softc *sc;
struct ifnet *ifp;
@@ -519,10 +509,7 @@ nemointr(arg)
#ifndef __OpenBSD__ /* on openbsd, ipip_input() does it instead */
void
-nemo_input(m, af, ifp)
- struct mbuf *m;
- int af;
- struct ifnet *ifp;
+nemo_input(struct mbuf *m, int af, struct ifnet *ifp)
{
#ifndef __FreeBSD__
int s;
@@ -635,10 +622,7 @@ nemo_input(m, af, ifp)
/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
int
-nemo_ioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+nemo_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct nemo_softc *sc = (struct nemo_softc*)ifp;
struct ifreq *ifr = (struct ifreq*)data;
@@ -992,10 +976,7 @@ nemo_ioctl(ifp, cmd, data)
}
int
-nemo_set_tunnel(ifp, src, dst)
- struct ifnet *ifp;
- struct sockaddr *src;
- struct sockaddr *dst;
+nemo_set_tunnel(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst)
{
struct nemo_softc *sc = (struct nemo_softc *)ifp;
struct nemo_softc *sc2;
@@ -1125,8 +1106,7 @@ nemo_set_tunnel(ifp, src, dst)
}
void
-nemo_delete_tunnel(ifp)
- struct ifnet *ifp;
+nemo_delete_tunnel(struct ifnet *ifp)
{
struct nemo_softc *sc = (struct nemo_softc *)ifp;
int s;
View
20 kame/sys/net/if_nemo.h
@@ -1,4 +1,4 @@
-/* $KAME: if_nemo.h,v 1.7 2007/03/30 09:47:22 keiichi Exp $ */
+/* $KAME: if_nemo.h,v 1.8 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -112,20 +112,20 @@ extern int nnemo;
extern struct nemo_softc *nemo_softc;
/* Prototypes */
-void nemoattach0 __P((struct nemo_softc *));
+void nemoattach0(struct nemo_softc *);
#ifndef __OpenBSD__
-void nemo_input __P((struct mbuf *, int, struct ifnet *));
+void nemo_input(struct mbuf *, int, struct ifnet *);
#endif
-int nemo_output __P((struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *));
-int nemo_ioctl __P((struct ifnet *, u_long, caddr_t));
-int nemo_set_tunnel __P((struct ifnet *, struct sockaddr *, struct sockaddr *));
-void nemo_delete_tunnel __P((struct ifnet *));
+int nemo_output(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
+int nemo_ioctl(struct ifnet *, u_long, caddr_t);
+int nemo_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
+void nemo_delete_tunnel(struct ifnet *);
#ifdef __OpenBSD__
-void nemo_start __P((struct ifnet *));
+void nemo_start(struct ifnet *);
#endif
#ifdef GIF_ENCAPCHECK
-int nemo_encapcheck __P((const struct mbuf *, int, int, void *));
+int nemo_encapcheck(const struct mbuf *, int, int, void *);
#endif
#endif /* !defined(__APPLE__) || (defined(__APPLE__) && defined(KERNEL_PRIVATE)) */
View
89 kame/sys/net/if_stf.c
@@ -1,4 +1,4 @@
-/* $KAME: if_stf.c,v 1.122 2007/05/22 12:19:45 itojun Exp $ */
+/* $KAME: if_stf.c,v 1.123 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 2000 WIDE Project.
@@ -68,7 +68,7 @@
* either.
*
* 6to4 interface has security issues. Refer to
- * http://playground.iijlab.net/i-d/draft-itojun-ipv6-transition-abuse-00.txt
+ * http://ftp.itojun.org/pub/paper/draft-itojun-ipv6-transition-abuse-01.txt
* and RFC3946 for details. The code tries to filter out some of malicious
* packets.
* Note that there is NO WAY to be 100% secure.
@@ -198,30 +198,29 @@ struct protosw in_stf_protosw =
};
#ifdef __FreeBSD__
-void stfattach __P((void *));
+void stfattach(void *);
#else
-void stfattach __P((int));
+void stfattach(int);
#endif
-static int stf_encapcheck __P((const struct mbuf *, int, int, void *));
-static struct in6_ifaddr *stf_getsrcifa6 __P((struct ifnet *));
-static int stf_output __P((struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *));
-static int isrfc1918addr __P((struct in_addr *));
-static int stf_checkaddr4 __P((struct stf_softc *, struct in_addr *,
- struct ifnet *));
-static int stf_checkaddr6 __P((struct stf_softc *, struct in6_addr *,
- struct ifnet *));
-static int stf_checkaddr46 __P((struct stf_softc *, struct in_addr *,
- struct in6_addr *));
-static void stf_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *));
-static int stf_ioctl __P((struct ifnet *, u_long, caddr_t));
+static int stf_encapcheck(const struct mbuf *, int, int, void *);
+static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *);
+static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
+static int isrfc1918addr(struct in_addr *);
+static int stf_checkaddr4(struct stf_softc *, struct in_addr *,
+ struct ifnet *);
+static int stf_checkaddr6(struct stf_softc *, struct in6_addr *,
+ struct ifnet *);
+static int stf_checkaddr46(struct stf_softc *, struct in_addr *,
+ struct in6_addr *);
+static void stf_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
+static int stf_ioctl(struct ifnet *, u_long, caddr_t);
void
-stfattach(dummy)
#ifdef __FreeBSD__
- void *dummy;
+stfattach(void *dummy)
#else
- int dummy;
+stfattach(int dummy)
#endif
{
struct stf_softc *sc;
@@ -290,11 +289,7 @@ PSEUDO_SET(stfattach, if_stf);
#endif
static int
-stf_encapcheck(m, off, proto, arg)
- const struct mbuf *m;
- int off;
- int proto;
- void *arg;
+stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
{
struct ip ip;
struct in6_ifaddr *ia6;
@@ -358,8 +353,7 @@ stf_encapcheck(m, off, proto, arg)
}
static struct in6_ifaddr *
-stf_getsrcifa6(ifp)
- struct ifnet *ifp;
+stf_getsrcifa6(struct ifnet *ifp)
{
struct ifaddr *ia;
struct in_ifaddr *ia4;
@@ -413,11 +407,8 @@ stf_getsrcifa6(ifp)
#endif
static int
-stf_output(ifp, m, dst, rt)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct rtentry *rt;
+stf_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
{
#ifdef __OpenBSD__
struct stf_softc *sc;
@@ -707,9 +698,9 @@ stf_output(ifp, m, dst, rt)
}
static int
-isrfc1918addr(in)
- struct in_addr *in;
+isrfc1918addr(struct in_addr *in)
{
+
/*
* returns 1 if private address range:
* 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
@@ -722,11 +713,9 @@ isrfc1918addr(in)
return 0;
}
+/* inifp - incoming interface */
static int
-stf_checkaddr4(sc, in, inifp)
- struct stf_softc *sc;
- struct in_addr *in;
- struct ifnet *inifp; /* incoming interface */
+stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp)
{
struct in_ifaddr *ia4;
@@ -811,11 +800,9 @@ stf_checkaddr4(sc, in, inifp)
return 0;
}
+/* inifp - incoming interface */
static int
-stf_checkaddr6(sc, in6, inifp)
- struct stf_softc *sc;
- struct in6_addr *in6;
- struct ifnet *inifp; /* incoming interface */
+stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp)
{
/*
@@ -858,20 +845,18 @@ stf_checkaddr6(sc, in6, inifp)
static int
stf_checkaddr46(struct stf_softc *sc, struct in_addr *in, struct in6_addr *in6)
{
+
return 1;
}
void
#ifdef __FreeBSD__
-in_stf_input(m, off)
- struct mbuf *m;
- int off;
+in_stf_input(struct mbuf *m, int off)
#else
#if __STDC__
in_stf_input(struct mbuf *m, ...)
#else
-in_stf_input(m, va_alist)
- struct mbuf *m;
+in_stf_input(struct mbuf *m, va_alist)
#endif
#endif
{
@@ -1023,10 +1008,7 @@ in_stf_input(m, va_alist)
/* ARGSUSED */
static void
-stf_rtrequest(cmd, rt, info)
- int cmd;
- struct rtentry *rt;
- struct rt_addrinfo *info;
+stf_rtrequest(int cmd, strut rtentry *rt, struct rt_addrinfo *info)
{
if (rt)
@@ -1034,10 +1016,7 @@ stf_rtrequest(cmd, rt, info)
}
static int
-stf_ioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct ifaddr *ifa;
struct ifreq *ifr;
View
6 kame/sys/net/if_stf.h
@@ -1,4 +1,4 @@
-/* $KAME: if_stf.h,v 1.10 2004/12/10 01:01:12 suz Exp $ */
+/* $KAME: if_stf.h,v 1.11 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 2000 WIDE Project.
@@ -55,9 +55,9 @@ struct stf_softc {
#ifdef _KERNEL
#ifdef __FreeBSD__
-void in_stf_input __P((struct mbuf *, int));
+void in_stf_input(struct mbuf *, int);
#else
-void in_stf_input __P((struct mbuf *, ...));
+void in_stf_input(struct mbuf *, ...);
#endif
#endif /* _KERNEL */
View
100 kame/sys/net/mipsock.c
@@ -1,4 +1,4 @@
-/* $Id: mipsock.c,v 1.26 2007/02/13 02:17:02 keiichi Exp $ */
+/* $Id: mipsock.c,v 1.27 2007/06/14 12:09:42 itojun Exp $ */
/*
* Copyright (C) 2004 WIDE Project.
@@ -106,8 +106,7 @@ static struct mbuf *mips_msg1(int type, int len);
* with raw_usrreq.c, since its functionality is so restricted. XXX
*/
static int
-mips_abort(so)
- struct socket *so;
+mips_abort(struct socket *so)
{
int s, error;
s = splnet();
@@ -119,10 +118,7 @@ mips_abort(so)
/* pru_accept is EOPNOTSUPP */
static int
-mips_attach(so, proto, p)
- struct socket *so;
- int proto;
- struct thread *p;
+mips_attach(struct socket *so, int proto, struct thread *p)
{
struct rawcb *rp;
int s, error;
@@ -166,10 +162,7 @@ mips_attach(so, proto, p)
}
static int
-mips_bind(so, nam, p)
- struct socket *so;
- struct sockaddr *nam;
- struct thread *p;
+mips_bind(struct socket *so, struct sockaddr *nam, struct thread *p)
{
int s, error;
@@ -180,10 +173,7 @@ mips_bind(so, nam, p)
}
static int
-mips_connect(so, nam, p)
- struct socket *so;
- struct sockaddr *nam;
- struct thread *p;
+mips_connect(struct socket *so, struct sockaddr *nam, struct thread *p)
{
int s, error;
@@ -197,8 +187,7 @@ mips_connect(so, nam, p)
/* pru_control is EOPNOTSUPP */
static int
-mips_detach(so)
- struct socket *so;
+mips_detach(struct socket *so)
{
struct rawcb *rp = sotorawcb(so);
int s, error;
@@ -218,8 +207,7 @@ mips_detach(so)
}
static int
-mips_disconnect(so)
- struct socket *so;
+mips_disconnect(struct socket *so)
{
int s, error;
@@ -232,9 +220,7 @@ mips_disconnect(so)
/* pru_listen is EOPNOTSUPP */
static int
-mips_peeraddr(so, nam)
- struct socket *so;
- struct sockaddr **nam;
+mips_peeraddr(struct socket *so, struct sockaddr **nam)
{
int s, error;
@@ -248,13 +234,8 @@ mips_peeraddr(so, nam)
/* pru_rcvoob is EOPNOTSUPP */
static int
-mips_send(so, flags, m, nam, control, p)
- struct socket *so;
- int flags;