/*
* 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.
*/
#ifndef _SYS_NETI_H
#define _SYS_NETI_H
#include <sys/int_types.h>
#include <sys/hook_impl.h>
#include <sys/netstack.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Network hooks framework stack protocol name
*/
/*
* Event identification
*/
/*
* Network NIC hardware checksum capability
*/
#define NET_IS_HCK_L3_FULL(n, x) \
#define NET_IS_HCK_L3_PART(n, x) \
#define NET_IS_HCK_L4_FULL(n, x) \
#define NET_IS_HCK_L4_PART(n, x) \
#define NET_IS_HCK_L34_FULL(n, x) \
== (NET_HCK_L3_FULL | NET_HCK_L4_FULL))
/*
* Netinfo interface specification
*
* Netinfo provides an extensible and easy to use interface for
* accessing data and functionality already embedded within network
* code that exists within the kernel.
*/
typedef enum net_ifaddr {
} net_ifaddr_t;
typedef enum inject {
} inject_t;
/*
* net_inject - public interface
*/
typedef struct net_inject {
int ni_version;
} net_inject_t;
/*
* net_protocol_t private interface
*/
struct net_protocol_s {
int netp_version;
char *netp_name;
const size_t);
size_t, net_ifaddr_t [], void *);
zoneid_t *);
uint64_t *);
struct sockaddr *);
};
/*
* Private data structures
*/
struct net_data {
int netd_refcnt;
int netd_condemned;
};
typedef struct injection_s {
void * inj_ptr;
} injection_t;
/*
* The ipif_id space is [0,MAX) but this interface wants to return [1,MAX] as
* a valid range of logical interface numbers so that it can return 0 to mean
* "end of list" with net_lifgetnext. Changing ipif_id's to use the [1,MAX]
* space is something to be considered for the future, if it is worthwhile.
*/
struct net_instance_s {
int nin_version;
char *nin_name;
};
struct net_instance_int_s {
void *nini_created;
};
/*
* netinfo stack instances
*/
struct neti_stack_s {
/* list of net_handle_t */
};
/*
* Internal functions that need to be exported within the module.
*/
extern void neti_init(void);
extern void neti_fini(void);
/*
* Functions available for public use.
*/
extern int net_event_notify_register(net_handle_t, char *,
hook_notify_fn_t, void *);
extern net_inject_t *net_inject_alloc(const int);
extern void net_inject_free(net_inject_t *);
extern void net_instance_free(net_instance_t *);
extern int net_instance_register(net_instance_t *);
extern int net_instance_unregister(net_instance_t *);
extern int net_protocol_release(net_handle_t);
extern int net_protocol_unregister(net_handle_t);
extern int net_getpmtuenabled(net_handle_t);
int, net_ifaddr_t [], void *);
struct sockaddr *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NETI_H */