Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys more "const"
details: https://anonhg.NetBSD.org/src/rev/af94ce01005d
branches: trunk
changeset: 762285:af94ce01005d
user: drochner <drochner%NetBSD.org@localhost>
date: Fri Feb 18 19:56:01 2011 +0000
description:
more "const"
diffstat:
sys/netipsec/key.c | 14 +++++++-------
sys/netipsec/keydb.h | 10 +++++-----
sys/netipsec/xform.h | 17 +++++++++--------
sys/netipsec/xform_ah.c | 23 ++++++++++++-----------
sys/netipsec/xform_esp.c | 24 ++++++++++++------------
sys/netipsec/xform_ipcomp.c | 12 ++++++------
sys/netipsec/xform_ipip.c | 6 +++---
sys/netipsec/xform_tcp.c | 6 +++---
sys/opencrypto/cryptodev.c | 23 ++++++++++++-----------
sys/opencrypto/cryptosoft_xform.c | 10 +++++-----
10 files changed, 74 insertions(+), 71 deletions(-)
diffs (truncated from 518 to 300 lines):
diff -r 22cd443c69e0 -r af94ce01005d sys/netipsec/key.c
--- a/sys/netipsec/key.c Fri Feb 18 19:27:06 2011 +0000
+++ b/sys/netipsec/key.c Fri Feb 18 19:56:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: key.c,v 1.64 2010/09/05 06:52:53 spz Exp $ */
+/* $NetBSD: key.c,v 1.65 2011/02/18 20:40:58 drochner Exp $ */
/* $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $ */
/* $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.64 2010/09/05 06:52:53 spz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.65 2011/02/18 20:40:58 drochner Exp $");
/*
* This code is referd to RFC 2367
@@ -6001,7 +6001,7 @@
key_getcomb_esp(void)
{
struct sadb_comb *comb;
- struct enc_xform *algo;
+ const struct enc_xform *algo;
struct mbuf *result = NULL, *m, *n;
int encmin;
int i, off, o;
@@ -6102,7 +6102,7 @@
key_getcomb_ah(void)
{
struct sadb_comb *comb;
- struct auth_hash *algo;
+ const struct auth_hash *algo;
struct mbuf *m;
u_int16_t minkeysize, maxkeysize;
int i;
@@ -6157,7 +6157,7 @@
key_getcomb_ipcomp(void)
{
struct sadb_comb *comb;
- struct comp_algo *algo;
+ const struct comp_algo *algo;
struct mbuf *m;
int i;
const int l = PFKEY_ALIGN8(sizeof(struct sadb_comb));
@@ -6755,7 +6755,7 @@
off += PFKEY_ALIGN8(sizeof(*sup));
for (i = 1; i <= SADB_AALG_MAX; i++) {
- struct auth_hash *aalgo;
+ const struct auth_hash *aalgo;
u_int16_t minkeysize, maxkeysize;
aalgo = ah_algorithm_lookup(i);
@@ -6779,7 +6779,7 @@
off += PFKEY_ALIGN8(sizeof(*sup));
for (i = 1; i <= SADB_EALG_MAX; i++) {
- struct enc_xform *ealgo;
+ const struct enc_xform *ealgo;
ealgo = esp_algorithm_lookup(i);
if (!ealgo)
diff -r 22cd443c69e0 -r af94ce01005d sys/netipsec/keydb.h
--- a/sys/netipsec/keydb.h Fri Feb 18 19:27:06 2011 +0000
+++ b/sys/netipsec/keydb.h Fri Feb 18 19:56:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: keydb.h,v 1.7 2010/08/28 07:16:51 spz Exp $ */
+/* $NetBSD: keydb.h,v 1.8 2011/02/18 20:40:58 drochner Exp $ */
/* $FreeBSD: src/sys/netipsec/keydb.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $KAME: keydb.h,v 1.14 2000/08/02 17:58:26 sakane Exp $ */
@@ -122,10 +122,10 @@
* to interface to the OpenBSD crypto support. This was done
* to distinguish this code from the mainline KAME code.
*/
- struct xformsw *tdb_xform; /* transform */
- struct enc_xform *tdb_encalgxform; /* encoding algorithm */
- struct auth_hash *tdb_authalgxform; /* authentication algorithm */
- struct comp_algo *tdb_compalgxform; /* compression algorithm */
+ const struct xformsw *tdb_xform; /* transform */
+ const struct enc_xform *tdb_encalgxform; /* encoding algorithm */
+ const struct auth_hash *tdb_authalgxform; /* authentication algorithm */
+ const struct comp_algo *tdb_compalgxform; /* compression algorithm */
u_int64_t tdb_cryptoid; /* crypto session id */
#ifdef IPSEC_NAT_T
diff -r 22cd443c69e0 -r af94ce01005d sys/netipsec/xform.h
--- a/sys/netipsec/xform.h Fri Feb 18 19:27:06 2011 +0000
+++ b/sys/netipsec/xform.h Fri Feb 18 19:56:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform.h,v 1.5 2011/02/18 19:06:45 drochner Exp $ */
+/* $NetBSD: xform.h,v 1.6 2011/02/18 20:40:58 drochner Exp $ */
/* $FreeBSD: src/sys/netipsec/xform.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ipsp.h,v 1.119 2002/03/14 01:27:11 millert Exp $ */
/*
@@ -89,7 +89,7 @@
#define XFT_CONF 0x0100
#define XFT_COMP 0x1000
const char *xf_name; /* human-readable name */
- int (*xf_init)(struct secasvar*, struct xformsw*); /* setup */
+ int (*xf_init)(struct secasvar*, const struct xformsw*);/* setup */
int (*xf_zeroize)(struct secasvar*); /* cleanup */
int (*xf_input)(struct mbuf*, const struct secasvar*, /* input */
int, int);
@@ -111,17 +111,18 @@
struct mbuf **, int, int);
/* XF_AH */
-extern int ah_init0(struct secasvar *, struct xformsw *, struct cryptoini *);
+extern int ah_init0(struct secasvar *, const struct xformsw *,
+ struct cryptoini *);
extern int ah_zeroize(struct secasvar *sav);
-extern struct auth_hash *ah_algorithm_lookup(int alg);
-extern size_t ah_hdrsiz(struct secasvar *);
+extern const struct auth_hash *ah_algorithm_lookup(int alg);
+extern size_t ah_hdrsiz(const struct secasvar *);
/* XF_ESP */
-extern struct enc_xform *esp_algorithm_lookup(int alg);
-extern size_t esp_hdrsiz(struct secasvar *sav);
+extern const struct enc_xform *esp_algorithm_lookup(int alg);
+extern size_t esp_hdrsiz(const struct secasvar *sav);
/* XF_COMP */
-extern struct comp_algo *ipcomp_algorithm_lookup(int alg);
+extern const struct comp_algo *ipcomp_algorithm_lookup(int alg);
#endif /* _KERNEL */
#endif /* !_NETIPSEC_XFORM_H_ */
diff -r 22cd443c69e0 -r af94ce01005d sys/netipsec/xform_ah.c
--- a/sys/netipsec/xform_ah.c Fri Feb 18 19:27:06 2011 +0000
+++ b/sys/netipsec/xform_ah.c Fri Feb 18 19:56:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_ah.c,v 1.30 2011/02/18 19:06:45 drochner Exp $ */
+/* $NetBSD: xform_ah.c,v 1.31 2011/02/18 20:40:58 drochner Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
/*
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.30 2011/02/18 19:06:45 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.31 2011/02/18 20:40:58 drochner Exp $");
#include "opt_inet.h"
#ifdef __FreeBSD__
@@ -123,7 +123,7 @@
/*
* NB: this is public for use by the PF_KEY support.
*/
-struct auth_hash *
+const struct auth_hash *
ah_algorithm_lookup(int alg)
{
if (alg >= AH_ALG_MAX)
@@ -152,7 +152,7 @@
}
size_t
-ah_hdrsiz(struct secasvar *sav)
+ah_hdrsiz(const struct secasvar *sav)
{
size_t size;
@@ -174,9 +174,10 @@
* NB: public for use by esp_init.
*/
int
-ah_init0(struct secasvar *sav, struct xformsw *xsp, struct cryptoini *cria)
+ah_init0(struct secasvar *sav, const struct xformsw *xsp,
+ struct cryptoini *cria)
{
- struct auth_hash *thash;
+ const struct auth_hash *thash;
int keylen;
thash = ah_algorithm_lookup(sav->alg_auth);
@@ -227,7 +228,7 @@
* ah_init() is called when an SPI is being set up.
*/
static int
-ah_init(struct secasvar *sav, struct xformsw *xsp)
+ah_init(struct secasvar *sav, const struct xformsw *xsp)
{
struct cryptoini cria;
int error;
@@ -600,7 +601,7 @@
static int
ah_input(struct mbuf *m, const struct secasvar *sav, int skip, int protoff)
{
- struct auth_hash *ahx;
+ const struct auth_hash *ahx;
struct tdb_ident *tdbi;
struct tdb_crypto *tc;
struct m_tag *mtag;
@@ -796,7 +797,7 @@
unsigned char calc[AH_ALEN_MAX];
struct mbuf *m;
struct cryptodesc *crd;
- struct auth_hash *ahx;
+ const struct auth_hash *ahx;
struct tdb_crypto *tc;
struct m_tag *mtag;
struct secasvar *sav;
@@ -846,7 +847,7 @@
("ah_input_cb: unexpected protocol family %u",
saidx->dst.sa.sa_family));
- ahx = (struct auth_hash *) sav->tdb_authalgxform;
+ ahx = sav->tdb_authalgxform;
/* Check for crypto errors. */
if (crp->crp_etype) {
@@ -994,7 +995,7 @@
)
{
const struct secasvar *sav;
- struct auth_hash *ahx;
+ const struct auth_hash *ahx;
struct cryptodesc *crda;
struct tdb_crypto *tc;
struct mbuf *mi;
diff -r 22cd443c69e0 -r af94ce01005d sys/netipsec/xform_esp.c
--- a/sys/netipsec/xform_esp.c Fri Feb 18 19:27:06 2011 +0000
+++ b/sys/netipsec/xform_esp.c Fri Feb 18 19:56:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xform_esp.c,v 1.27 2011/02/18 19:06:45 drochner Exp $ */
+/* $NetBSD: xform_esp.c,v 1.28 2011/02/18 20:40:58 drochner Exp $ */
/* $FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.27 2011/02/18 19:06:45 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.28 2011/02/18 20:40:58 drochner Exp $");
#include "opt_inet.h"
#ifdef __FreeBSD__
@@ -110,7 +110,7 @@
* NB: this is public for use by the PF_KEY support.
* NB: if you add support here; be sure to add code to esp_attach below!
*/
-struct enc_xform *
+const struct enc_xform *
esp_algorithm_lookup(int alg)
{
if (alg >= ESP_ALG_MAX)
@@ -135,7 +135,7 @@
}
size_t
-esp_hdrsiz(struct secasvar *sav)
+esp_hdrsiz(const struct secasvar *sav)
{
size_t size;
@@ -169,9 +169,9 @@
* esp_init() is called when an SPI is being set up.
*/
static int
-esp_init(struct secasvar *sav, struct xformsw *xsp)
+esp_init(struct secasvar *sav, const struct xformsw *xsp)
{
- struct enc_xform *txform;
+ const struct enc_xform *txform;
struct cryptoini cria, crie;
int keylen;
int error;
@@ -278,8 +278,8 @@
static int
esp_input(struct mbuf *m, const struct secasvar *sav, int skip, int protoff)
{
- struct auth_hash *esph;
- struct enc_xform *espx;
+ const struct auth_hash *esph;
+ const struct enc_xform *espx;
struct tdb_ident *tdbi;
struct tdb_crypto *tc;
int plen, alen, hlen;
@@ -467,8 +467,8 @@
int s, hlen, skip, protoff, error;
struct mbuf *m;
struct cryptodesc *crd;
- struct auth_hash *esph;
- struct enc_xform *espx;
+ const struct auth_hash *esph;
+ const struct enc_xform *espx;
struct tdb_crypto *tc;
struct m_tag *mtag;
struct secasvar *sav;
@@ -696,8 +696,8 @@
int protoff
)
{
- struct enc_xform *espx;
- struct auth_hash *esph;
Home |
Main Index |
Thread Index |
Old Index