ipsec_input.c (266800) | ipsec_input.c (269699) |
---|---|
1/* $FreeBSD: head/sys/netipsec/ipsec_input.c 266800 2014-05-28 12:45:27Z vanhu $ */ | 1/* $FreeBSD: head/sys/netipsec/ipsec_input.c 269699 2014-08-08 01:57:15Z kevlo $ */ |
2/* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */ 3/*- 4 * The authors of this code are John Ioannidis (ji@tla.org), 5 * Angelos D. Keromytis (kermit@csd.uch.gr) and 6 * Niels Provos (provos@physnet.uni-hamburg.de). 7 * 8 * This code was written by John Ioannidis for BSD/OS in Athens, Greece, 9 * in November 1995. --- 239 unchanged lines hidden (view full) --- 249 off = va_arg(ap, int); 250 nxt = va_arg(ap, int); 251 va_end(ap); 252 253 return ipsec_common_input(m, off, offsetof(struct ip, ip_p), 254 AF_INET, nxt); 255} 256 | 2/* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */ 3/*- 4 * The authors of this code are John Ioannidis (ji@tla.org), 5 * Angelos D. Keromytis (kermit@csd.uch.gr) and 6 * Niels Provos (provos@physnet.uni-hamburg.de). 7 * 8 * This code was written by John Ioannidis for BSD/OS in Athens, Greece, 9 * in November 1995. --- 239 unchanged lines hidden (view full) --- 249 off = va_arg(ap, int); 250 nxt = va_arg(ap, int); 251 va_end(ap); 252 253 return ipsec_common_input(m, off, offsetof(struct ip, ip_p), 254 AF_INET, nxt); 255} 256 |
257void 258ah4_input(struct mbuf *m, int off) | 257int 258ah4_input(struct mbuf **mp, int *offp, int proto) |
259{ | 259{ |
260 struct mbuf *m; 261 int off; 262 263 m = *mp; 264 off = *offp; 265 *mp = NULL; 266 |
|
260 ipsec4_common_input(m, off, IPPROTO_AH); | 267 ipsec4_common_input(m, off, IPPROTO_AH); |
268 return (IPPROTO_DONE); |
|
261} 262void 263ah4_ctlinput(int cmd, struct sockaddr *sa, void *v) 264{ 265 if (sa->sa_family == AF_INET && 266 sa->sa_len == sizeof(struct sockaddr_in)) 267 ipsec4_common_ctlinput(cmd, sa, v, IPPROTO_AH); 268} 269 | 269} 270void 271ah4_ctlinput(int cmd, struct sockaddr *sa, void *v) 272{ 273 if (sa->sa_family == AF_INET && 274 sa->sa_len == sizeof(struct sockaddr_in)) 275 ipsec4_common_ctlinput(cmd, sa, v, IPPROTO_AH); 276} 277 |
270void 271esp4_input(struct mbuf *m, int off) | 278int 279esp4_input(struct mbuf **mp, int *offp, int proto) |
272{ | 280{ |
281 struct mbuf *m; 282 int off; 283 284 m = *mp; 285 off = *offp; 286 mp = NULL; 287 |
|
273 ipsec4_common_input(m, off, IPPROTO_ESP); | 288 ipsec4_common_input(m, off, IPPROTO_ESP); |
289 return (IPPROTO_DONE); |
|
274} | 290} |
291 |
|
275void 276esp4_ctlinput(int cmd, struct sockaddr *sa, void *v) 277{ 278 if (sa->sa_family == AF_INET && 279 sa->sa_len == sizeof(struct sockaddr_in)) 280 ipsec4_common_ctlinput(cmd, sa, v, IPPROTO_ESP); 281} 282 | 292void 293esp4_ctlinput(int cmd, struct sockaddr *sa, void *v) 294{ 295 if (sa->sa_family == AF_INET && 296 sa->sa_len == sizeof(struct sockaddr_in)) 297 ipsec4_common_ctlinput(cmd, sa, v, IPPROTO_ESP); 298} 299 |
283void 284ipcomp4_input(struct mbuf *m, int off) | 300int 301ipcomp4_input(struct mbuf **mp, int *offp, int proto) |
285{ | 302{ |
303 struct mbuf *m; 304 int off; 305 306 m = *mp; 307 off = *offp; 308 mp = NULL; 309 |
|
286 ipsec4_common_input(m, off, IPPROTO_IPCOMP); | 310 ipsec4_common_input(m, off, IPPROTO_IPCOMP); |
311 return (IPPROTO_DONE); |
|
287} 288 289/* 290 * IPsec input callback for INET protocols. 291 * This routine is called as the transform callback. 292 * Takes care of filtering and other sanity checks on 293 * the processed packet. 294 */ --- 619 unchanged lines hidden --- | 312} 313 314/* 315 * IPsec input callback for INET protocols. 316 * This routine is called as the transform callback. 317 * Takes care of filtering and other sanity checks on 318 * the processed packet. 319 */ --- 619 unchanged lines hidden --- |