4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
30 * This file includes strcutures, macros and routines used by general
33 #include <sys/types.h>
34 #include <netinet/in.h>
35 #include <sys/mac_flow.h>
37 #include <sys/param.h>
40 #include <libdladm_impl.h>
46 typedef struct dladm_flow_attr
{
47 datalink_id_t fa_linkid
;
48 char fa_flowname
[MAXFLOWNAMELEN
];
49 flow_desc_t fa_flow_desc
;
50 mac_resource_props_t fa_resource_props
;
55 extern dladm_status_t
dladm_flow_add(dladm_handle_t
, datalink_id_t
,
56 dladm_arg_list_t
*, dladm_arg_list_t
*, char *,
57 boolean_t
, const char *);
58 extern dladm_status_t
dladm_flow_remove(dladm_handle_t
, char *, boolean_t
,
60 extern dladm_status_t
dladm_flow_init(dladm_handle_t
);
62 extern dladm_status_t
dladm_flow_parse_db(char *, dld_flowinfo_t
*);
63 extern dladm_status_t
dladm_walk_flow(int (*)(dladm_handle_t
,
64 dladm_flow_attr_t
*, void *), dladm_handle_t
,
65 datalink_id_t
, void *, boolean_t
);
66 extern dladm_status_t
dladm_flow_info(dladm_handle_t
, const char *,
69 extern dladm_status_t
dladm_set_flowprop(dladm_handle_t
, const char *,
70 const char *, char **, uint_t
, uint_t
, char **);
71 extern dladm_status_t
dladm_get_flowprop(dladm_handle_t
, const char *,
72 uint32_t, const char *, char **, uint_t
*);
73 extern dladm_status_t
dladm_walk_flowprop(int (*)(void *, const char *),
74 const char *, void *);
76 extern void dladm_flow_attr_mask(uint64_t, dladm_flow_attr_t
*);
77 extern dladm_status_t
dladm_flow_attr_check(dladm_arg_list_t
*);
78 extern dladm_status_t
dladm_prefixlen2mask(int, int, uchar_t
*);
79 extern dladm_status_t
dladm_mask2prefixlen(in6_addr_t
*, int, int *);
80 extern char *dladm_proto2str(uint8_t);
81 extern uint8_t dladm_str2proto(const char *);
83 extern void dladm_flow_attr_ip2str(dladm_flow_attr_t
*,
85 extern void dladm_flow_attr_proto2str(dladm_flow_attr_t
*,
87 extern void dladm_flow_attr_port2str(dladm_flow_attr_t
*,
89 extern void dladm_flow_attr_dsfield2str(dladm_flow_attr_t
*,
96 #endif /* _LIBDLFLOW_H */