]>
git.proxmox.com Git - mirror_ovs.git/blob - ofproto/bundles.h
2 * Copyright (c) 2013, 2014 Alexandru Copot <alex.mihai.c@gmail.com>, with support from IXIA.
3 * Copyright (c) 2013, 2014 Daniel Baluta <dbaluta@ixiacom.com>
4 * Copyright (c) 2014, 2015, 2016, 2017 Nicira, Inc.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 #include <sys/types.h>
25 #include "ofproto-provider.h"
26 #include "openvswitch/ofp-msgs.h"
33 struct ofp_bundle_entry
{
35 enum ofptype type
; /* OFPTYPE_FLOW_MOD, OFPTYPE_PORT_MOD,
36 * OFPTYPE_GROUP_MOD, OFPTYPE_PACKET_OUT. */
37 struct ofp_header
*msg
; /* Original request, for error reporting. */
39 struct ofproto_flow_mod ofm
;
40 struct ofproto_port_mod opm
;
41 struct ofproto_group_mod ogm
;
42 struct ofproto_packet_out opo
;
52 struct hmap_node node
; /* In struct ofconn's "bundles" hmap. */
53 long long int used
; /* Last time bundle was used. */
56 enum bundle_state state
;
57 struct ofp_header
*msg
; /* Original request, for error reporting. */
58 struct ovs_list msg_list
; /* List of 'struct bundle_message's */
61 static inline void ofp_bundle_entry_free(struct ofp_bundle_entry
*);
63 enum ofperr
ofp_bundle_open(struct ofconn
*, uint32_t id
, uint16_t flags
,
64 const struct ofp_header
*);
65 enum ofperr
ofp_bundle_close(struct ofconn
*, uint32_t id
, uint16_t flags
);
66 enum ofperr
ofp_bundle_discard(struct ofconn
*, uint32_t id
);
67 enum ofperr
ofp_bundle_add_message(struct ofconn
*, uint32_t id
,
68 uint16_t flags
, struct ofp_bundle_entry
*,
69 const struct ofp_header
*);
71 void ofp_bundle_remove__(struct ofconn
*, struct ofp_bundle
*);
74 ofp_bundle_entry_free(struct ofp_bundle_entry
*entry
)
77 if (entry
->type
== OFPTYPE_FLOW_MOD
) {
78 ofproto_flow_mod_uninit(&entry
->ofm
);
79 } else if (entry
->type
== OFPTYPE_GROUP_MOD
) {
80 ofputil_uninit_group_mod(&entry
->ogm
.gm
);
81 } else if (entry
->type
== OFPTYPE_PACKET_OUT
) {
82 ofproto_packet_out_uninit(&entry
->opo
);