/*
* Copyright (C) 2003 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
*/
#endif
#if __FreeBSD_version >= 300000
#endif
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <ctype.h>
#include <unistd.h>
#include <nlist.h>
#include "ipf.h"
#include "netinet/ip_lookup.h"
#include "netinet/ip_htable.h"
#include "kmem.h"
#include "ipfzone.h"
extern int ippool_yyparse __P((void));
extern int ippool_yydebug;
extern FILE *ippool_yyin;
extern char *optarg;
extern int lineNum;
int poolcommand __P((int, int, char *[]));
int poolnodecommand __P((int, int, char *[]));
int loadpoolfile __P((int, char *[], char *));
void poollist_dead __P((int, char *, int, char *, char *));
void showpools_live(int, int, ip_pool_stat_t *, char *, int);
void showhashs_live(int, int, iphtstat_t *, char *, int);
int opts = 0;
int use_inet6 = 0;
char *prog;
{
zoneopt);
zoneopt);
zoneopt);
zoneopt);
zoneopt);
exit(1);
}
int argc;
char *argv[];
{
int err;
if (argc < 2)
{
case 'a' :
break;
case 'A' :
break;
case 'f' :
break;
case 'F' :
break;
case 'l' :
break;
case 'r' :
break;
case 'R' :
break;
case 's' :
break;
default :
exit(1);
}
return err;
}
char *argv[];
{
ipset = 0;
role = IPL_LOGIPF;
switch (c)
{
case 'd' :
break;
case 'G' :
break;
case 'i' :
if (s == NULL)
return -1;
} else {
}
if (s != NULL)
*s = '\0';
ipset = 1;
break;
case 'm' :
break;
case 'n' :
opts |= OPT_DONOTHING;
break;
case 'o' :
if (role == IPL_LOGNONE)
return -1;
break;
case 'R' :
opts |= OPT_NORESOLVE;
break;
case 'v' :
opts |= OPT_VERBOSE;
break;
case 'z' :
break;
}
if (ipset == 0)
return -1;
return -1;
}
if (remove == 0)
else
return err;
}
char *argv[];
{
char *poolname;
err = 1;
role = 0;
type = 0;
role = IPL_LOGIPF;
switch (c)
{
case 'd' :
break;
case 'G' :
break;
case 'm' :
break;
case 'n' :
opts |= OPT_DONOTHING;
break;
case 'o' :
if (role == IPL_LOGNONE) {
return -1;
}
break;
case 'R' :
opts |= OPT_NORESOLVE;
break;
case 'S' :
break;
case 't' :
return -1;
}
break;
case 'v' :
opts |= OPT_VERBOSE;
break;
case 'z' :
break;
}
return -1;
}
}
if (remove == 0) {
switch (type)
{
case IPLT_HASH :
break;
case IPLT_POOL :
break;
}
} else {
switch (type)
{
case IPLT_HASH :
break;
case IPLT_POOL :
break;
}
}
return err;
}
int argc;
{
int c;
switch (c)
{
case 'd' :
break;
case 'G' :
break;
case 'n' :
opts |= OPT_DONOTHING;
break;
case 'R' :
opts |= OPT_NORESOLVE;
break;
case 'u' :
opts |= OPT_REMOVE;
break;
case 'v' :
opts |= OPT_VERBOSE;
break;
case 'z' :
break;
}
if (fd == -1) {
perror("open(IPLOOKUP_NAME)");
exit(1);
}
exit(1);
}
}
return -1;
return 0;
}
int argc;
char *argv[];
{
live_kernel = 1;
role = IPL_LOGALL;
switch (c)
{
case 'd' :
break;
case 'G' :
break;
case 'm' :
break;
case 'M' :
live_kernel = 0;
break;
case 'N' :
live_kernel = 0;
break;
case 'o' :
if (role == IPL_LOGNONE) {
return -1;
}
break;
case 'R' :
opts |= OPT_NORESOLVE;
break;
case 't' :
return -1;
}
break;
case 'v' :
opts |= OPT_VERBOSE;
break;
case 'z' :
break;
}
if (fd == -1) {
perror("open(IPLOOKUP_NAME)");
exit(1);
}
exit(1);
}
}
}
if (live_kernel == 0) {
return (0);
}
if (role != IPL_LOGALL) {
if (c == -1) {
perror("ioctl(SIOCLOOKUPSTAT)");
return -1;
}
} else {
if (c == -1) {
perror("ioctl(SIOCLOOKUPSTAT)");
return -1;
}
}
role = IPL_LOGALL;
}
}
if (role != IPL_LOGALL) {
if (c == -1) {
perror("ioctl(SIOCLOOKUPSTAT)");
return -1;
}
} else {
if (c == -1) {
perror("ioctl(SIOCLOOKUPSTAT)");
return -1;
}
}
}
}
return 0;
}
{
exit(-1);
return;
return;
if (role != IPL_LOGALL) {
}
} else {
}
}
role = IPL_LOGALL;
}
}
return;
return;
if (role != IPL_LOGALL) {
}
} else {
}
}
}
}
}
void
char *poolname;
int opts;
{
perror("ioctl(SIOCLOOKUPITER)");
break;
}
}
}
int argc;
char *argv[];
{
live_kernel = 1;
role = IPL_LOGALL;
switch (c)
{
case 'd' :
break;
case 'G' :
break;
case 'M' :
live_kernel = 0;
break;
case 'N' :
live_kernel = 0;
break;
case 'o' :
if (role == IPL_LOGNONE) {
return -1;
}
break;
case 't' :
"-s not supported for this type yet\n");
return -1;
}
break;
case 'v' :
opts |= OPT_VERBOSE;
break;
case 'z' :
break;
}
if (fd == -1) {
perror("open(IPLOOKUP_NAME)");
exit(1);
}
exit(1);
}
}
if (!(opts & OPT_DONOTHING)) {
if (c == -1) {
perror("ioctl(SIOCLOOKUPSTAT)");
return -1;
}
}
}
if (!(opts & OPT_DONOTHING)) {
if (c == -1) {
perror("ioctl(SIOCLOOKUPSTAT)");
return -1;
}
}
}
return 0;
}
int argc;
char *argv[];
{
role = IPL_LOGALL;
switch (c)
{
case 'd' :
break;
case 'o' :
if (role == IPL_LOGNONE) {
return -1;
}
break;
case 't' :
return -1;
}
break;
case 'v' :
opts |= OPT_VERBOSE;
break;
case 'z' :
break;
}
if (fd == -1) {
perror("open(IPLOOKUP_NAME)");
exit(1);
}
exit(1);
}
}
if (!(opts & OPT_DONOTHING)) {
perror("ioctl(SIOCLOOKUPFLUSH)");
exit(1);
}
}
return 0;
}
char *rolename;
{
int role;
role = IPL_LOGIPF;
#if 0
role = IPL_LOGNAT;
role = IPL_LOGSTATE;
role = IPL_LOGAUTH;
role = IPL_LOGSYNC;
role = IPL_LOGSCAN;
role = IPL_LOGCOUNT;
#endif
} else {
role = IPL_LOGNONE;
}
return role;
}
char *typename;
{
int type;
*minor = IPHASH_LOOKUP;
*minor = IPHASH_GROUPMAP;
} else {
}
return type;
}
char *poolname;
int opts;
{
perror("ioctl(SIOCLOOKUPITER)");
break;
}
}
}