]>
Commit | Line | Data |
---|---|---|
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" |
f22716dc | 27 | |
ccbe50f8 | 28 | struct flow; |
88ca35ee | 29 | struct ofpbuf; |
a9a2da38 | 30 | struct ofputil_flow_mod; |
2b07c8b1 | 31 | struct ofputil_flow_monitor_request; |
81d1ea94 | 32 | struct ofputil_flow_stats_request; |
7395c052 | 33 | struct ofputil_group_mod; |
638a19b0 | 34 | struct ofputil_meter_mod; |
918f2b82 | 35 | struct ofputil_table_mod; |
5a0a5702 | 36 | struct simap; |
db0b6c29 | 37 | enum ofputil_protocol; |
f22716dc | 38 | |
db0b6c29 | 39 | char *parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_, |
ba2fe8e9 | 40 | enum ofputil_protocol *usable_protocols) |
bdda5aca | 41 | WARN_UNUSED_RESULT; |
0199c526 | 42 | |
bdda5aca | 43 | char *parse_ofp_flow_mod_str(struct ofputil_flow_mod *, const char *string, |
db0b6c29 | 44 | uint16_t command, |
ba2fe8e9 | 45 | enum ofputil_protocol *usable_protocols) |
bdda5aca | 46 | WARN_UNUSED_RESULT; |
918f2b82 AZ |
47 | |
48 | char *parse_ofp_table_mod(struct ofputil_table_mod *, | |
49 | const char *table_id, const char *flow_miss_handling, | |
50 | enum ofputil_protocol *usable_protocols) | |
51 | WARN_UNUSED_RESULT; | |
52 | ||
bdda5aca | 53 | char *parse_ofp_flow_mod_file(const char *file_name, uint16_t command, |
db0b6c29 | 54 | struct ofputil_flow_mod **fms, size_t *n_fms, |
ba2fe8e9 | 55 | enum ofputil_protocol *usable_protocols) |
bdda5aca | 56 | WARN_UNUSED_RESULT; |
8050b31d | 57 | |
bdda5aca | 58 | char *parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *, |
db0b6c29 | 59 | bool aggregate, const char *string, |
ba2fe8e9 | 60 | enum ofputil_protocol *usable_protocols) |
bdda5aca | 61 | WARN_UNUSED_RESULT; |
f22716dc | 62 | |
db0b6c29 JR |
63 | char *parse_ofpacts(const char *, struct ofpbuf *ofpacts, |
64 | enum ofputil_protocol *usable_protocols) | |
bdda5aca | 65 | WARN_UNUSED_RESULT; |
0c3d5fc8 | 66 | |
5a0a5702 GS |
67 | char *parse_ofp_exact_flow(struct flow *flow, struct flow *mask, const char *s, |
68 | const struct simap *portno_names); | |
ccbe50f8 | 69 | |
bdda5aca | 70 | char *parse_ofp_meter_mod_str(struct ofputil_meter_mod *, const char *string, |
db0b6c29 JR |
71 | int command, |
72 | enum ofputil_protocol *usable_protocols) | |
bdda5aca | 73 | WARN_UNUSED_RESULT; |
638a19b0 | 74 | |
bdda5aca | 75 | char *parse_flow_monitor_request(struct ofputil_flow_monitor_request *, |
db0b6c29 JR |
76 | const char *, |
77 | enum ofputil_protocol *usable_protocols) | |
bdda5aca | 78 | WARN_UNUSED_RESULT; |
2b07c8b1 | 79 | |
7395c052 NZ |
80 | char *parse_ofp_group_mod_file(const char *file_name, uint16_t command, |
81 | struct ofputil_group_mod **gms, size_t *n_gms, | |
82 | enum ofputil_protocol *usable_protocols) | |
83 | WARN_UNUSED_RESULT; | |
84 | ||
85 | char *parse_ofp_group_mod_str(struct ofputil_group_mod *, uint16_t command, | |
86 | const char *string, | |
87 | enum ofputil_protocol *usable_protocols) | |
88 | WARN_UNUSED_RESULT; | |
89 | ||
4caacc1e BP |
90 | char *str_to_u8(const char *str, const char *name, uint8_t *valuep) |
91 | WARN_UNUSED_RESULT; | |
92 | char *str_to_u16(const char *str, const char *name, uint16_t *valuep) | |
93 | WARN_UNUSED_RESULT; | |
94 | char *str_to_u32(const char *str, uint32_t *valuep) WARN_UNUSED_RESULT; | |
95 | char *str_to_u64(const char *str, uint64_t *valuep) WARN_UNUSED_RESULT; | |
96 | char *str_to_be64(const char *str, ovs_be64 *valuep) WARN_UNUSED_RESULT; | |
97 | char *str_to_mac(const char *str, uint8_t mac[6]) WARN_UNUSED_RESULT; | |
98 | char *str_to_ip(const char *str, ovs_be32 *ip) WARN_UNUSED_RESULT; | |
99 | ||
f22716dc | 100 | #endif /* ofp-parse.h */ |