1/* 2 * Copyright (C) 1998-2001 by Darren Reed & Guido van Rooij. 3 * 4 * See the IPFILTER.LICENCE file for details on licencing. 5 */ |
6#ifdef __sgi 7# include <sys/ptimers.h> 8#endif |
9#include <sys/errno.h> 10#include <sys/types.h> 11#include <sys/param.h> 12#include <sys/time.h> 13#include <sys/file.h> 14#if !defined(_KERNEL) && !defined(KERNEL) 15# include <stdio.h> 16# include <stdlib.h> 17# include <string.h> 18#endif 19#if (defined(KERNEL) || defined(_KERNEL)) && (__FreeBSD_version >= 220000) 20# include <sys/filio.h> 21# include <sys/fcntl.h> 22#else 23# include <sys/ioctl.h> 24#endif |
25#ifndef linux 26# include <sys/protosw.h> 27#endif 28#include <sys/socket.h> 29#if (defined(_KERNEL) || defined(KERNEL)) && !defined(linux) 30# include <sys/systm.h> 31#endif 32#if !defined(__SVR4) && !defined(__svr4__) --- 67 unchanged lines hidden (view full) --- 100# if (defined(_KERNEL) || defined(KERNEL)) && !defined(IPFILTER_LKM) 101# include <sys/libkern.h> 102# include <sys/systm.h> 103# endif 104#endif 105 106#if !defined(lint) 107/* static const char rcsid[] = "@(#)$Id: ip_auth.c,v 2.11.2.12 2001/07/18 14:57:08 darrenr Exp $"; */ |
108static const char rcsid[] = "@(#)$FreeBSD: head/sys/contrib/ipfilter/netinet/ip_auth.c 92685 2002-03-19 11:44:16Z darrenr $"; |
109#endif 110 111 112#if (SOLARIS || defined(__sgi)) && defined(_KERNEL) 113extern KRWLOCK_T ipf_auth, ipf_mutex; 114extern kmutex_t ipf_authmx; 115# if SOLARIS 116extern kcondvar_t ipfauthwait; --- 191 unchanged lines hidden (view full) --- 308#endif 309 return 1; 310} 311 312 313int fr_auth_ioctl(data, mode, cmd, fr, frptr) 314caddr_t data; 315int mode; |
316#if defined(__NetBSD__) || defined(__OpenBSD__) || (__FreeBSD_version >= 300003) |
317u_long cmd; 318#else 319int cmd; 320#endif 321frentry_t *fr, **frptr; 322{ 323 mb_t *m; 324#if defined(_KERNEL) && !SOLARIS --- 54 unchanged lines hidden (view full) --- 379 SPL_X(s); 380 RWLOCK_EXIT(&ipf_auth); 381 } else 382 error = ENOMEM; 383 } else 384 error = EINVAL; 385 break; 386 case SIOCATHST: |
387 fr_authstats.fas_faelist = fae_list; |
388 error = IWCOPYPTR((char *)&fr_authstats, data, 389 sizeof(fr_authstats)); 390 break; 391 case SIOCAUTHW: 392 if (!(mode & FWRITE)) { 393 error = EPERM; 394 break; 395 } --- 57 unchanged lines hidden (view full) --- 453 if (m && au->fra_info.fin_out) { 454# if SOLARIS 455 error = fr_qout(fra->fra_q, m); 456# else /* SOLARIS */ 457 struct route ro; 458 459 bzero((char *)&ro, sizeof(ro)); 460# if ((_BSDI_VERSION >= 199802) && (_BSDI_VERSION < 200005)) || \ |
461 defined(__OpenBSD__) || (defined(IRIX) && (IRIX >= 605)) |
462 error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL, 463 NULL); 464# else 465 error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL); 466# endif 467 if (ro.ro_rt) { 468 RTFREE(ro.ro_rt); 469 } --- 51 unchanged lines hidden (view full) --- 521 default : 522 error = EINVAL; 523 break; 524 } 525 return error; 526} 527 528 |
529/* 530 * Free all network buffer memory used to keep saved packets. 531 */ 532void fr_authunload() 533{ 534 register int i; 535 register frauthent_t *fae, **faep; 536 frentry_t *fr, **frp; --- 44 unchanged lines hidden (view full) --- 581 */ 582void fr_authexpire() 583{ 584 register int i; 585 register frauth_t *fra; 586 register frauthent_t *fae, **faep; 587 register frentry_t *fr, **frp; 588 mb_t *m; |
589#if !SOLARIS && defined(_KERNEL) |
590 int s; 591#endif 592 593 if (fr_auth_lock) 594 return; 595 596 SPL_NET(s); 597 WRITE_ENTER(&ipf_auth); --- 22 unchanged lines hidden (view full) --- 620 *frp = fr->fr_next; 621 KFREE(fr); 622 } else 623 frp = &fr->fr_next; 624 } 625 RWLOCK_EXIT(&ipf_auth); 626 SPL_X(s); 627} |