Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Nicira(OpenVSwitch) ct, and ct_clear actions #560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion java_gen/java_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ def gen_fixed_length_string_jtype(length):
u32 = JType('long', 'int') \
.op(read='U32.f(bb.readInt())', write='bb.writeInt(U32.t($name))', pub_type=True) \
.op(read='bb.readInt()', write='bb.writeInt($name)', pub_type=False)
u16_list = JType('List<U16>', 'short[]') \
.op(read='ChannelUtils.readList(bb, $length, U16.READER)',
write='ChannelUtils.writeList(bb, $name)',
default="ImmutableList.<U16>of()",
funnel="FunnelUtils.putList($name, sink)")
u32_list = JType('List<U32>', 'int[]') \
.op(
read='ChannelUtils.readList(bb, $length, U32.READER)',
Expand Down Expand Up @@ -386,7 +391,7 @@ def gen_fixed_length_string_jtype(length):
.op(read="IPv6Address.read16Bytes(bb)", \
write="$name.write16Bytes(bb)",
default='IPv6Address.NONE')
ipv6_list = JType('List<IPv46ddress>') \
ipv6_list = JType('List<IPv6Address>') \
.op(read='ChannelUtils.readList(bb, $length, IPv6Address.READER)',
write='ChannelUtils.writeList(bb, $name)',
default='ImmutableList.<IPv6Address>of()',
Expand Down Expand Up @@ -590,6 +595,7 @@ def gen_fixed_length_string_jtype(length):
'list(of_packet_queue_t)' : packet_queue_list,
'list(of_uint64_t)' : u64_list,
'list(of_uint32_t)' : u32_list,
'list(of_uint16_t)' : u16_list,
'list(of_uint8_t)' : u8_list,
'list(of_oxm_t)' : oxm_list,
'list(of_oxs_t)' : oxs_list,
Expand Down Expand Up @@ -681,6 +687,14 @@ def gen_fixed_length_string_jtype(length):
'of_oxm_pbb_uca' : { 'value' : boolean_value },
'of_oxm_pbb_uca_masked' : { 'value' : boolean_value, 'value_mask' : boolean_value },

'of_oxm_conntrack_state' : { 'value' : u32obj },
'of_oxm_conntrack_state_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_conntrack_zone' : { 'value' : u16obj },
'of_oxm_conntrack_mark' : { 'value' : u32obj },
'of_oxm_conntrack_mark_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_conntrack_label' : { 'value' : port_bitmap_128 },
'of_oxm_conntrack_label_masked' : { 'value' : port_bitmap_128, 'value_mask' : port_bitmap_128 },

'of_oxm_tcp_flags' : { 'value' : u16obj },
'of_oxm_tcp_flags_masked' : { 'value' : u16obj, 'value_mask' : u16obj },
'of_oxm_ovs_tcp_flags' : { 'value' : u16obj },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ private MatchField(final String name, final MatchFields id, Prerequisite<?>... p
public final static MatchField<IPv4Address> IPV4_DST =
new MatchField<IPv4Address>("ipv4_dst", MatchFields.IPV4_DST,
new Prerequisite<EthType>(MatchField.ETH_TYPE, EthType.IPv4));


public final static MatchField<U32> CONNTRACK_STATE =
new MatchField<U32>("ct_state", MatchFields.CONNTRACK_STATE);

public final static MatchField<U16> CONNTRACK_ZONE =
new MatchField<U16>("ct_zone", MatchFields.CONNTRACK_ZONE);

public final static MatchField<U32> CONNTRACK_MARK =
new MatchField<U32>("ct_mark", MatchFields.CONNTRACK_MARK);

public final static MatchField<TransportPort> TCP_SRC = new MatchField<TransportPort>(
"tcp_src", MatchFields.TCP_SRC,
new Prerequisite<IpProtocol>(MatchField.IP_PROTO, IpProtocol.TCP));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public enum MatchFields {
MPLS_TC,
MPLS_BOS,
TUNNEL_ID,
CONNTRACK_STATE,
CONNTRACK_ZONE,
CONNTRACK_MARK,
CONNTRACK_LABEL,
IPV6_EXTHDR,
PBB_UCA,
TCP_FLAGS,
Expand Down
45 changes: 45 additions & 0 deletions openflow_input/nicira_ct
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2015, Big Switch Networks, Inc.
//
// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
// the following special exception:
//
// LOXI Exception
//
// As a special exception to the terms of the EPL, you may distribute libraries
// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
// that copyright and licensing notices generated by LoxiGen are not altered or removed
// from the LoxiGen Libraries and the notice provided below is (i) included in
// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
// documentation for the LoxiGen Libraries, if distributed in binary form.
//
// Notice: "Copyright 2015, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
//
// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
// a copy of the EPL at:
//
// http://www.eclipse.org/legal/epl-v10.html
//
// 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
// EPL for the specific language governing permissions and limitations
// under the EPL.

#version 3
#version 4
#version 5
#version 6

struct of_action_nicira_ct : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 35;
uint16_t flags;
uint32_t zone_src;
uint16_t zone;
uint8_t recirc_table;
pad(3);
uint16_t alg;
list(of_action_t) actions;
};
39 changes: 39 additions & 0 deletions openflow_input/nicira_ct_clear
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2015, Big Switch Networks, Inc.
//
// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
// the following special exception:
//
// LOXI Exception
//
// As a special exception to the terms of the EPL, you may distribute libraries
// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
// that copyright and licensing notices generated by LoxiGen are not altered or removed
// from the LoxiGen Libraries and the notice provided below is (i) included in
// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
// documentation for the LoxiGen Libraries, if distributed in binary form.
//
// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
//
// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
// a copy of the EPL at:
//
// http://www.eclipse.org/legal/epl-v10.html
//
// 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
// EPL for the specific language governing permissions and limitations
// under the EPL.

#version 3
#version 4
#version 5
#version 6

struct of_action_nicira_ct_clear : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 43;
pad(6);
};
63 changes: 63 additions & 0 deletions openflow_input/oxm_nicira_ct
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2013, Big Switch Networks, Inc.
//
// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
// the following special exception:
//
// LOXI Exception
//
// As a special exception to the terms of the EPL, you may distribute libraries
// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
// that copyright and licensing notices generated by LoxiGen are not altered or removd
// from the LoxiGen Libraries and the notice provided below is (i) included in
// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
// documentation for the LoxiGen Libraries, if distributed in binary form.
//
// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by t"
//
// You may not use this file except in compliance with the EPL or LOXI Exception. Youn
// a copy of the EPL at:
//
// http://www.eclipse.org/legal/epl-v10.html
//
// 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
// EPL for the specific language governing permissions and limitations
// under the EPL.
#version 3
#version 4
#version 5
#version 6

struct of_oxm_conntrack_state : of_oxm {
uint32_t type_len == 0x0001d204;
uint32_t value;
};

struct of_oxm_conntrack_state_masked : of_oxm {
uint32_t type_len == 0x0001d308;
uint32_t value;
uint32_t value_mask;
};

struct of_oxm_conntrack_zone : of_oxm {
uint32_t type_len == 0x0001d402;
uint16_t value;
};

struct of_oxm_conntrack_zone_masked : of_oxm {
uint32_t type_len == 0x0001d504;
uint16_t value;
uint16_t value_mask;
};

struct of_oxm_conntrack_mark : of_oxm {
uint32_t type_len == 0x0001d604;
uint32_t value;
};

struct of_oxm_conntrack_mark_masked : of_oxm {
uint32_t type_len == 0x0001d708;
uint32_t value;
uint32_t value_mask;
};