/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file implements the function calls for ipnet that translate the
* calls from BPF into the correct arguments and functions inside of the
* ipnet device.
*/
static const char *ipnet_bpf_name(uintptr_t);
static void ipnet_bpf_client_close(uintptr_t);
static const char *ipnet_bpf_client_name(uintptr_t);
static void ipnet_bpf_close(uintptr_t);
uintptr_t *, int);
static void ipnet_bpf_promisc_remove(uintptr_t);
static int ipnet_bpf_type(uintptr_t);
};
/*ARGSUSED*/
static int
{
}
/*ARGSUSED*/
static void
{
}
static const char *
{
}
/*ARGSUSED*/
static int
{
return (DL_IPNET);
}
/*ARGSUSED*/
static void
{
/*
* The choice of 65535 is arbitrary, it could be any smaller number
* but it does matche the current default choice of libpcap as the
* packet snap size.
*/
*mtup = 65535;
}
/*ARGSUSED*/
static int
{
/*
* It is not clear what it would mean to send an ipnet packet,
* especially since the ipnet device has been implemented to be
* an observation (read-only) instrument. Thus a call to send a
* packet using ipnet results in the packet being free'd and an
* error returned.
*/
return (EBADF);
}
/*
* BPF does not provide the means to select which SAP is being sniffed,
* so for the purpose of ipnet, all BPF clients are in SAP promiscuous
* mode.
*/
static uintptr_t
{
int newhow;
/*
* Map the mac values into ipnet values.
*/
switch (how) {
case MAC_CLIENT_PROMISC_ALL :
break;
case MAC_CLIENT_PROMISC_MULTI :
break;
default :
newhow = 0;
break;
}
}
static void
{
ipnet_promisc_remove((void *)phandle);
}
static int
{
}
/*ARGSUSED*/
static void
{
}
static const char *
{
return (ipnet_bpf_name(chandle));
}
static int
{
int error;
index = 0;
if (error == 0)
return (error);
}
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}