1
/* Copyright (c) 2013 Nicira, Inc.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at:
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License. */
15
#ifndef OFPROT_DPIF_MIRROR_H
16
#define OFPROT_DPIF_MIRROR_H 1
22
#define MAX_MIRRORS 32
23
typedef uint32_t mirror_mask_t;
28
struct mbridge *mbridge_create(void);
29
struct mbridge *mbridge_ref(const struct mbridge *);
30
void mbridge_unref(struct mbridge *);
31
bool mbridge_has_mirrors(struct mbridge *);
32
bool mbridge_need_revalidate(struct mbridge *);
34
void mbridge_register_bundle(struct mbridge *, struct ofbundle *);
35
void mbridge_unregister_bundle(struct mbridge *, struct ofbundle *);
37
mirror_mask_t mirror_bundle_out(struct mbridge *, struct ofbundle *);
38
mirror_mask_t mirror_bundle_src(struct mbridge *, struct ofbundle *);
39
mirror_mask_t mirror_bundle_dst(struct mbridge *, struct ofbundle *);
41
int mirror_set(struct mbridge *, void *aux, const char *name,
42
struct ofbundle **srcs, size_t n_srcs,
43
struct ofbundle **dsts, size_t n_dsts,
44
unsigned long *src_vlans, struct ofbundle *out_bundle,
46
void mirror_destroy(struct mbridge *, void *aux);
47
int mirror_get_stats(struct mbridge *, void *aux, uint64_t *packets,
49
void mirror_update_stats(struct mbridge*, mirror_mask_t, uint64_t packets,
51
bool mirror_get(struct mbridge *, int index, unsigned long **vlans,
52
mirror_mask_t *dup_mirrors, struct ofbundle **out,
56
mirror_mask_ffs(mirror_mask_t mask)
58
BUILD_ASSERT_DECL(sizeof(unsigned int) >= sizeof(mask));
61
#endif /* ofproto-dpif-mirror.h */