-/* $OpenBSD: ip_ah.c,v 1.116 2015/04/17 11:04:01 mikeb Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.117 2015/06/15 12:37:37 mikeb Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
#define DPRINTF(x)
#endif
-int ah_output_cb(void *);
-int ah_input_cb(void *);
+int ah_output_cb(struct cryptop *);
+int ah_input_cb(struct cryptop *);
int ah_massage_headers(struct mbuf **, int, int, int, int);
struct ahstat ahstat;
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
crp->crp_flags = CRYPTO_F_IMBUF;
- crp->crp_buf = (caddr_t) m;
- crp->crp_callback = (int (*) (struct cryptop *)) ah_input_cb;
+ crp->crp_buf = (caddr_t)m;
+ crp->crp_callback = ah_input_cb;
crp->crp_sid = tdb->tdb_cryptoid;
- crp->crp_opaque = (caddr_t) tc;
+ crp->crp_opaque = (caddr_t)tc;
/* These are passed as-is to the callback. */
tc->tc_skip = skip;
* AH input callback, called directly by the crypto driver.
*/
int
-ah_input_cb(void *op)
+ah_input_cb(struct cryptop *crp)
{
int s, roff, rplen, error, skip, protoff;
unsigned char calc[AH_ALEN_MAX];
struct mbuf *m1, *m0, *m;
struct auth_hash *ahx;
struct tdb_crypto *tc;
- struct cryptop *crp;
struct tdb *tdb;
u_int32_t btsx, esn;
caddr_t ptr;
char buf[INET6_ADDRSTRLEN];
#endif
- crp = (struct cryptop *) op;
-
tc = (struct tdb_crypto *) crp->crp_opaque;
skip = tc->tc_skip;
protoff = tc->tc_protoff;
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
crp->crp_flags = CRYPTO_F_IMBUF;
- crp->crp_buf = (caddr_t) m;
- crp->crp_callback = (int (*) (struct cryptop *)) ah_output_cb;
+ crp->crp_buf = (caddr_t)m;
+ crp->crp_callback = ah_output_cb;
crp->crp_sid = tdb->tdb_cryptoid;
- crp->crp_opaque = (caddr_t) tc;
+ crp->crp_opaque = (caddr_t)tc;
/* These are passed as-is to the callback. */
tc->tc_skip = skip;
* AH output callback, called directly from the crypto handler.
*/
int
-ah_output_cb(void *op)
+ah_output_cb(struct cryptop *crp)
{
int skip, error;
struct tdb_crypto *tc;
- struct cryptop *crp;
struct tdb *tdb;
struct mbuf *m;
caddr_t ptr;
int err, s;
- crp = (struct cryptop *) op;
tc = (struct tdb_crypto *) crp->crp_opaque;
skip = tc->tc_skip;
ptr = (caddr_t) (tc + 1);
-/* $OpenBSD: ip_esp.c,v 1.131 2015/04/17 11:04:01 mikeb Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.132 2015/06/15 12:37:37 mikeb Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
#include "bpfilter.h"
-int esp_output_cb(void *);
-int esp_input_cb(void *);
+int esp_output_cb(struct cryptop *);
+int esp_input_cb(struct cryptop *);
#ifdef ENCDEBUG
#define DPRINTF(x) if (encdebug) printf x
/* Crypto operation descriptor */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length */
crp->crp_flags = CRYPTO_F_IMBUF;
- crp->crp_buf = (caddr_t) m;
- crp->crp_callback = (int (*) (struct cryptop *)) esp_input_cb;
+ crp->crp_buf = (caddr_t)m;
+ crp->crp_callback = esp_input_cb;
crp->crp_sid = tdb->tdb_cryptoid;
- crp->crp_opaque = (caddr_t) tc;
+ crp->crp_opaque = (caddr_t)tc;
/* These are passed as-is to the callback */
tc->tc_skip = skip;
* ESP input callback, called directly by the crypto driver.
*/
int
-esp_input_cb(void *op)
+esp_input_cb(struct cryptop *crp)
{
u_int8_t lastthree[3], aalg[AH_HMAC_MAX_HASHLEN];
int s, hlen, roff, skip, protoff, error;
struct mbuf *m1, *mo, *m;
struct auth_hash *esph;
struct tdb_crypto *tc;
- struct cryptop *crp;
struct tdb *tdb;
u_int32_t btsx, esn;
caddr_t ptr;
char buf[INET6_ADDRSTRLEN];
#endif
- crp = (struct cryptop *) op;
-
tc = (struct tdb_crypto *) crp->crp_opaque;
skip = tc->tc_skip;
protoff = tc->tc_protoff;
/* Crypto operation descriptor. */
crp->crp_ilen = m->m_pkthdr.len; /* Total input length. */
crp->crp_flags = CRYPTO_F_IMBUF;
- crp->crp_buf = (caddr_t) m;
- crp->crp_callback = (int (*) (struct cryptop *)) esp_output_cb;
- crp->crp_opaque = (caddr_t) tc;
+ crp->crp_buf = (caddr_t)m;
+ crp->crp_callback = esp_output_cb;
+ crp->crp_opaque = (caddr_t)tc;
crp->crp_sid = tdb->tdb_cryptoid;
if (esph) {
* ESP output callback, called directly by the crypto driver.
*/
int
-esp_output_cb(void *op)
+esp_output_cb(struct cryptop *crp)
{
- struct cryptop *crp = (struct cryptop *) op;
struct tdb_crypto *tc;
struct tdb *tdb;
struct mbuf *m;