2010-07-28 15:14:28 -07:00
|
|
|
/*
|
2017-05-31 16:06:12 -07:00
|
|
|
* Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
|
2010-07-28 15:14:28 -07:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at:
|
2010-08-30 00:24:53 -07:00
|
|
|
*
|
2010-07-28 15:14:28 -07:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2010-08-30 00:24:53 -07:00
|
|
|
*
|
2010-07-28 15:14:28 -07:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2010-08-30 00:24:53 -07:00
|
|
|
*/
|
|
|
|
|
2010-07-28 15:14:28 -07:00
|
|
|
/* OpenFlow protocol string to flow parser. */
|
|
|
|
|
2016-03-25 14:10:23 -07:00
|
|
|
#ifndef OPENVSWITCH_OFP_PARSE_H
|
|
|
|
#define OPENVSWITCH_OFP_PARSE_H 1
|
2010-07-28 15:14:28 -07:00
|
|
|
|
2010-12-07 13:32:01 -08:00
|
|
|
#include <stdbool.h>
|
2010-07-28 15:14:28 -07:00
|
|
|
#include <stdint.h>
|
2010-09-23 13:19:49 -07:00
|
|
|
#include <stdio.h>
|
2016-03-25 14:10:23 -07:00
|
|
|
#include "openvswitch/compiler.h"
|
2018-02-09 10:04:26 -08:00
|
|
|
#include "openvswitch/ofp-protocol.h"
|
2014-07-25 17:21:14 -07:00
|
|
|
#include "openvswitch/types.h"
|
2010-07-28 15:14:28 -07:00
|
|
|
|
2017-07-30 18:03:24 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-02-09 10:04:26 -08:00
|
|
|
struct match;
|
|
|
|
struct mf_field;
|
|
|
|
struct ofputil_port_map;
|
2010-07-28 15:14:28 -07:00
|
|
|
|
2018-02-09 10:04:26 -08:00
|
|
|
struct ofp_protocol {
|
|
|
|
const char *name;
|
|
|
|
uint16_t dl_type;
|
|
|
|
uint8_t nw_proto;
|
|
|
|
};
|
2010-11-08 10:37:52 -08:00
|
|
|
|
2018-02-09 10:04:26 -08:00
|
|
|
bool ofp_parse_protocol(const char *name, const struct ofp_protocol **);
|
2012-05-04 09:52:37 -07:00
|
|
|
|
2018-02-09 10:04:26 -08:00
|
|
|
char *ofp_extract_actions(char *);
|
|
|
|
char *ofp_parse_field(const struct mf_field *, const char *,
|
|
|
|
const struct ofputil_port_map *, struct match *,
|
|
|
|
enum ofputil_protocol *usable_protocols)
|
openflow: Table maintenance commands for Geneve options.
In order to work with Geneve options, we need to maintain a mapping
table between an option (defined by <class, type, length>) and
an NXM field that can be operated on for the purposes of matches,
actions, etc. This mapping must be explicitly specified by the
user.
Conceptually, this table could be communicated using either OpenFlow
or OVSDB. Using OVSDB requires less code and definition of extensions
than OpenFlow but introduces the possibility that mapping table
updates and flow modifications are desynchronized from each other.
This is dangerous because the mapping table signifcantly impacts the
way that flows using Geneve options are installed and processed by
OVS. Therefore, the mapping table is maintained using OpenFlow commands
instead, which opens the possibility of using synchronization between
table changes and flow modifications through barriers, bundles, etc.
There are two primary groups of OpenFlow messages that are introduced
as Nicira extensions: modification commands (add, delete, clear mappings)
and table status request/reply to dump the current table along with switch
information.
Note that mappings should not be changed while they are in active use by
a flow. The result of doing so is undefined.
This only adds the OpenFlow infrastructure but doesn't actually
do anything with the information yet after the messages have been
decoded.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-06-02 15:11:00 -07:00
|
|
|
OVS_WARN_UNUSED_RESULT;
|
|
|
|
|
2014-07-25 17:21:14 -07:00
|
|
|
char *str_to_u8(const char *str, const char *name, uint8_t *valuep)
|
2014-12-15 14:10:38 +01:00
|
|
|
OVS_WARN_UNUSED_RESULT;
|
2014-07-25 17:21:14 -07:00
|
|
|
char *str_to_u16(const char *str, const char *name, uint16_t *valuep)
|
2014-12-15 14:10:38 +01:00
|
|
|
OVS_WARN_UNUSED_RESULT;
|
|
|
|
char *str_to_u32(const char *str, uint32_t *valuep) OVS_WARN_UNUSED_RESULT;
|
|
|
|
char *str_to_u64(const char *str, uint64_t *valuep) OVS_WARN_UNUSED_RESULT;
|
|
|
|
char *str_to_be64(const char *str, ovs_be64 *valuep) OVS_WARN_UNUSED_RESULT;
|
2015-08-28 14:55:11 -07:00
|
|
|
char *str_to_mac(const char *str, struct eth_addr *mac) OVS_WARN_UNUSED_RESULT;
|
2014-12-15 14:10:38 +01:00
|
|
|
char *str_to_ip(const char *str, ovs_be32 *ip) OVS_WARN_UNUSED_RESULT;
|
Add support for connection tracking helper/ALGs.
This patch adds support for specifying a "helper" or ALG to assist
connection tracking for protocols that consist of multiple streams.
Initially, only support for FTP is included.
Below is an example set of flows to allow FTP control connections from
port 1->2 to establish active data connections in the reverse direction:
table=0,priority=1,action=drop
table=0,arp,action=normal
table=0,in_port=1,tcp,action=ct(alg=ftp,commit),2
table=0,in_port=2,tcp,ct_state=-trk,action=ct(table=1)
table=1,in_port=2,tcp,ct_state=+trk+est,action=1
table=1,in_port=2,tcp,ct_state=+trk+rel,action=ct(commit),1
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-09-15 14:29:16 -07:00
|
|
|
char *str_to_connhelper(const char *str, uint16_t *alg) OVS_WARN_UNUSED_RESULT;
|
2018-02-09 10:04:26 -08:00
|
|
|
|
|
|
|
/* Handy utility for parsing flows and actions. */
|
|
|
|
bool ofputil_parse_key_value(char **stringp, char **keyp, char **valuep);
|
2014-07-25 17:21:14 -07:00
|
|
|
|
2017-07-30 18:03:24 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-07-28 15:14:28 -07:00
|
|
|
#endif /* ofp-parse.h */
|