]> git.proxmox.com Git - mirror_ovs.git/blame - lib/ofp-parse.h
lib: Move compiler.h to <openvswitch/compiler.h>
[mirror_ovs.git] / lib / ofp-parse.h
CommitLineData
f22716dc 1/*
4caacc1e 2 * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
f22716dc
JP
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
d295e8e9 7 *
f22716dc 8 * http://www.apache.org/licenses/LICENSE-2.0
d295e8e9 9 *
f22716dc
JP
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
d295e8e9
JP
15 */
16
f22716dc
JP
17/* OpenFlow protocol string to flow parser. */
18
19#ifndef OFP_PARSE_H
20#define OFP_PARSE_H 1
21
88ca35ee 22#include <stdbool.h>
f22716dc 23#include <stdint.h>
15f1f1b6 24#include <stdio.h>
bdda5aca 25#include "compiler.h"
4caacc1e 26#include "openvswitch/types.h"
3bd0fd39 27#include "packets.h"
f22716dc 28
ccbe50f8 29struct flow;
88ca35ee 30struct ofpbuf;
a9a2da38 31struct ofputil_flow_mod;
2b07c8b1 32struct ofputil_flow_monitor_request;
81d1ea94 33struct ofputil_flow_stats_request;
7395c052 34struct ofputil_group_mod;
638a19b0 35struct ofputil_meter_mod;
918f2b82 36struct ofputil_table_mod;
5a0a5702 37struct simap;
db0b6c29 38enum ofputil_protocol;
f22716dc 39
db0b6c29 40char *parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_,
ba2fe8e9 41 enum ofputil_protocol *usable_protocols)
cab50449 42 OVS_WARN_UNUSED_RESULT;
0199c526 43
bdda5aca 44char *parse_ofp_flow_mod_str(struct ofputil_flow_mod *, const char *string,
db0b6c29 45 uint16_t command,
ba2fe8e9 46 enum ofputil_protocol *usable_protocols)
cab50449 47 OVS_WARN_UNUSED_RESULT;
918f2b82
AZ
48
49char *parse_ofp_table_mod(struct ofputil_table_mod *,
50 const char *table_id, const char *flow_miss_handling,
51 enum ofputil_protocol *usable_protocols)
cab50449 52 OVS_WARN_UNUSED_RESULT;
918f2b82 53
bdda5aca 54char *parse_ofp_flow_mod_file(const char *file_name, uint16_t command,
db0b6c29 55 struct ofputil_flow_mod **fms, size_t *n_fms,
ba2fe8e9 56 enum ofputil_protocol *usable_protocols)
cab50449 57 OVS_WARN_UNUSED_RESULT;
8050b31d 58
bdda5aca 59char *parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *,
db0b6c29 60 bool aggregate, const char *string,
ba2fe8e9 61 enum ofputil_protocol *usable_protocols)
cab50449 62 OVS_WARN_UNUSED_RESULT;
f22716dc 63
5a0a5702
GS
64char *parse_ofp_exact_flow(struct flow *flow, struct flow *mask, const char *s,
65 const struct simap *portno_names);
ccbe50f8 66
bdda5aca 67char *parse_ofp_meter_mod_str(struct ofputil_meter_mod *, const char *string,
db0b6c29
JR
68 int command,
69 enum ofputil_protocol *usable_protocols)
cab50449 70 OVS_WARN_UNUSED_RESULT;
638a19b0 71
bdda5aca 72char *parse_flow_monitor_request(struct ofputil_flow_monitor_request *,
db0b6c29
JR
73 const char *,
74 enum ofputil_protocol *usable_protocols)
cab50449 75 OVS_WARN_UNUSED_RESULT;
2b07c8b1 76
7395c052
NZ
77char *parse_ofp_group_mod_file(const char *file_name, uint16_t command,
78 struct ofputil_group_mod **gms, size_t *n_gms,
79 enum ofputil_protocol *usable_protocols)
cab50449 80 OVS_WARN_UNUSED_RESULT;
7395c052
NZ
81
82char *parse_ofp_group_mod_str(struct ofputil_group_mod *, uint16_t command,
83 const char *string,
84 enum ofputil_protocol *usable_protocols)
cab50449 85 OVS_WARN_UNUSED_RESULT;
7395c052 86
4caacc1e 87char *str_to_u8(const char *str, const char *name, uint8_t *valuep)
cab50449 88 OVS_WARN_UNUSED_RESULT;
4caacc1e 89char *str_to_u16(const char *str, const char *name, uint16_t *valuep)
cab50449
TG
90 OVS_WARN_UNUSED_RESULT;
91char *str_to_u32(const char *str, uint32_t *valuep) OVS_WARN_UNUSED_RESULT;
92char *str_to_u64(const char *str, uint64_t *valuep) OVS_WARN_UNUSED_RESULT;
93char *str_to_be64(const char *str, ovs_be64 *valuep) OVS_WARN_UNUSED_RESULT;
94char *str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN]) OVS_WARN_UNUSED_RESULT;
95char *str_to_ip(const char *str, ovs_be32 *ip) OVS_WARN_UNUSED_RESULT;
4caacc1e 96
f22716dc 97#endif /* ofp-parse.h */