1656 Commits

Author SHA1 Message Date
Simon Horman
5ba92e9ad2 Allow messages inside messages
Bundle Add Message and Request Forward Message, which is part of OpenFlow
1.4, encapsulates an OpenFlow message in side an OpenFlow message.

This patch prepares for this by adding a MsgInMsgBase class, a subclass of
MsgBase which allows its subclasses to include subclasses of either
MsgInMsgBase or MsgBase when when parsing classes from JSON: The MsgBase
class does not allow this.

This change has three parts:
* Remove the assertion in
  ofproto_parser.py:StringifyMixin::cls_from_jsondict_key()
  that cls is not a subclass of MsgBase.

* Pass **additional_args to various stringify.py:StringifyMixin decoder
  methods to make the datapath available when instantiating
  MsgBase subclasses.

* Override _decode_value() in MsgInMsgBase to pass **additional_args
  to decoder. The method in the parent class, StringifyMixin,
  does not pass **additional_args.

  The effect is to pass a datapath argument if
  the class is a subclass of MsgInMsgBase but not if the
  class is a direct subclass of MsgBase.

  By only making messages which allow messages inside them
  subclasses of MsgInMsgBase this allows the datapath
  argument to be passed to the decoder if and only if needed.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 20:43:05 +09:00
Kiyonari Harigae
e04d1697e0 ofctl_v1_2:support whole of match fields
Hi,

I tried to support for whole of match field with ofctl_v1_2.(same as ofctl_v1_3)
Also, changed table_id of get_flow_stats method from fixed 0 to OFPTT_ALL for enable to select arbitrary table_id by client side.

Thank you.

Signed-off-by: Kiyonari Harigae <lakshmi@cloudysunny14.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 16:13:32 +09:00
Sriram Natarajan
6ce45939de rest_router: fix OFPSetAsync bit mask
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-21 14:59:44 +09:00
YAMAMOTO Takashi
81d6f1e252 ofp_event: fix a typo
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-18 13:46:03 +09:00
Wei-Li Tang
97f81e58a2 ofctl_v1_2/3: IP arbitrary bitmask support
Openflow 1.1 and later versions allow the use of IP address with
arbitrary bitmask in match fields. This adds arbitrary bitmask
support to related functions.

After applying this patch, it's no longer compatible with ACL
hybrid CIDR format (Cisco-like ACL bitmasks) because such format
exists only in some router's ACL configuration.

Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-18 13:46:01 +09:00
Yuichi Ito
8728c11e12 sw test tool: Fix a problem for disconnection
Disconnection of switches has caused a RyuInternalError because target_sw/tester_sw is set to NoneType.
This patch fixes the problem.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 22:09:12 +09:00
Simon Horman
281067bf2b of14: Add bundle control message unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:28 +09:00
Simon Horman
d3e1e267f1 of14: Add bundle control message support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:27 +09:00
Simon Horman
a376cc93c8 of14: Remove incorrect OFP_ASYNC_CONFIG_{PACK_STR, SIZE}
OFP_ASYNC_CONFIG_PACK_STR and OFP_ASYNC_CONFIG_SIZE are based
on the OpenFlow 1.3 implementation and specification. However,
the Openflow 1.4 specification defines a rather different structure:

struct ofp_async_config {
    struct ofp_header header; /* OFPT_GET_ASYNC_REPLY or OFPT_SET_ASYNC. */
    /* Async config Property list - 0 or more */
    struct ofp_async_config_prop_header properties[0];
};
OFP_ASSERT(sizeof(struct ofp_async_config) == 8);

In implementation terms this means that OFP_ASYNC_CONFIG_PACK_STR
is empty and OFP_ASYNC_CONFIG_SIZE is zero. In the new implementation
these values are unused so simply remove them.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:26 +09:00
Simon Horman
c0a1fd6d99 of14: Update get async reply and set async implementation to follow spec
The current get async reply and get async implementations follows that of
of_protocol and OpenFlow 1.3. However, OpenFlow 1.4 defines a rather
different format. This patch updates the implementation to follow the
OpenFlow 1.4 specification.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:24 +09:00
Simon Horman
f9888ba941 of14: Add OFPAsyncConfigProp
This will be used by a revised implementations of
get async request reply and set async

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:23 +09:00
Simon Horman
7b3c1ab9cd of14: Add table status unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:22 +09:00
Simon Horman
5ae836b713 of14: Add table status support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:21 +09:00
Simon Horman
2316f5e03b of14: Add flow monitor reply message unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:21 +09:00
Simon Horman
dad67544d9 of14: Add flow monitor request unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:20 +09:00
Simon Horman
41c2d623a8 packet_data_generator: New ofproto dependency for v5 updates
Update ofproto dependency to include a merge of the mainline
v5 branch which includes:
* Bundle messages
* Flow monitor messages
* Request Forward message
* Table Status message
* Fix for length of Flow Update Full entry of Flow Monitor reply message

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:19 +09:00
Simon Horman
233c615dfd of14: Add flow monitor reply support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:06 +09:00
Simon Horman
3df9da512d of14: Add flow monitor request support
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:05 +09:00
Simon Horman
fbd51b60f7 of14: Add OFPFlowUpdate
This will be used by flow monitor reply messages

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:42:04 +09:00
ISHIDA Wataru
08f7517234 dpset: absorb *args, **kwargs passed to __init__
dpset might be initialied implicitly like OFPHandler.
In that case, _CONTEXTS are passed to dpset. so we should ignore them.

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:13:21 +09:00
Wei-Li Tang
06f343bb99 ofctl_v1_2/3: Convert IP fields to string with dotted decimal mask
This enables match_ip*_to_str() functions to output IP address with
dotted decimal subnet mask if the mask cannot be represented in CIDR
format.

Reported-by: Yi-Ching Lee <potatoching11@gmail.com>
Reported-by: Li-Der Chou <cld@csie.ncu.edu.tw>
Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 21:05:13 +09:00
watanabe.fumitaka
24b850f323 sw test tool: avoid test termination in initialization
The initialization error of the flow tables causes forced termination of the test,
 and has become the hindrance of execution of other tests.
This patch changes operation of the flow tables initialization error
 to avoid forced termination of the test.

Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:38:56 +09:00
Satoshi Kobayashi
e95a684aee ofctl_v1_2: Fix unsuitable log
When using type 'ALL', the log unsuitable is outputted:
Unknown type: ALL

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:38:45 +09:00
Satoshi Kobayashi
8fd3959d06 ofctl_v1_3: Fix unsuitable log
ofproto_v1_3.OFPGT_ALL is 0 and 0 is False on Python. When using type 'ALL', the following is set to True.

if not type_:
    LOG.debug('Unknown type: %s', group.get('type'))

Therefore, the log unsuitable is outputted:
Unknown type: ALL

Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:38:32 +09:00
YAMAMOTO Takashi
eb07d4bf81 library_packet.rst: fix an example code
Reported by Sebastian Gebhard on ryu-devel@.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:37:46 +09:00
YAMAMOTO Takashi
13ec0df56d pyang plugin to generate of_config.generated_classes
the current version of generated_classes was written by hand.
this plugin allows it to be auto-generated from the yang module
of OF-Config if/when it's available.

unfortunately, there seems to be no yang modules usable for this
purpose publically available yet, though.
the yang module of OF-Config 1.1.1 is embedded in pdf.  besides that
it's hard to extract from the pdf, its license is unclear.
OF-Config 1.2 says that its yang module is distributed as a separate
file.  but i couldn't find it on ONF site.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:37:39 +09:00
YAMAMOTO Takashi
6394a34804 fix NX_EXPERIMENTER_ID
also, comment registry url.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:36:54 +09:00
YAMAMOTO Takashi
7b1d0eb9d6 reduce direct uses of oslo.config.cfg.CONF
no functional changes are intended.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:28:10 +09:00
YAMAMOTO Takashi
934fc1516f ryu.cfg: re-export some frequently used stuff for convenience
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:28:09 +09:00
YAMAMOTO Takashi
6756ff595c add ryu.cfg
also, make CONF accessible via RyuApp.CONF.
add a comment to explain the intention.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:28:08 +09:00
Wei-Li Tang
e8d7eafc6d ryu.conf: obsoleted argument used in sample configuration
ofp_listen_port was obsoleted and users should use ofp_tcp_listen_port
(or ofp_ssl_listen_port if ssl enabled) instead.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 20:26:09 +09:00
Wei-Li Tang
d5ec1f2079 ofctl_v1_2/3: IPv4 dotted decimal subnet mask support
This enables to_match_ip() to accept IPv4 address with dotted decimal
subnet mask or ACL hybrid CIDR.

Given 3 match field values below:

    '192.168.1.0/24'
    '192.168.1.0/255.255.255.0'
    '192.168.1.0/0.0.0.255'

These addresses are logically equivalent.

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-16 18:06:01 +09:00
FUJITA Tomonori
5ce9e31b65 Ryu 3.7
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
v3.7
2014-03-05 17:18:36 +09:00
YAMAMOTO Takashi
b570fca1aa test_parser: update expected json representation
Update after experimenter data change.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:07:55 +09:00
YAMAMOTO Takashi
e0ce84983e OFPPropCommonExperimenter4ByteData: change payload to bytes
Change experimenter data from a list of 32-bit words to bytes.
Discussed on ryu-devel@.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:07:55 +09:00
YAMAMOTO Takashi
fb470142a6 Apply normalize_json.py
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-05 17:07:55 +09:00
Simon Horman
0c83f96ae7 of14: Correct documentation of table mod flags and properties
* Document properties
* The valid flags for OpenFlow 1.4 are OFPTC_EVICTION and OFPTC_VACANCY_EVENTS

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 15:29:54 +09:00
Simon Horman
ce11165ef4 of13: Correct documentation of meter mod flags
* Flags is a bitmap of OFPMF_* values rather than a
  single OFPMF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:48:10 +09:00
Simon Horman
0dc8cb87df of13: Correct documentation of flow mod flags
* Flags is a bitmap of OFPFF_* values rather than a
  single OFPFF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:48:01 +09:00
Simon Horman
4e54354d4e of13: Correct documentation of set config flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:47:52 +09:00
Simon Horman
663a4c1133 of13: Correct documentation and example of get config reply flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:47:42 +09:00
Simon Horman
7fb985f3a1 of14: Correct documentation of flow mod flags
* Flags is a bitmap of OFPFF_* values rather than a
  single OFPFF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:47:29 +09:00
Simon Horman
2f5a1a96e9 of14: Correct documentation of meter mod flags
* Flags is a bitmap of OFPMF_* values rather than a
  single OFPMF_* value

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:35:14 +09:00
Simon Horman
1ea8199013 of14: Correct documentation of set config flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:34:42 +09:00
Simon Horman
aa08ed2c78 of14: Correct documentation and example of get config reply flags
* Flags is a bitmap of OFPC_FRAG_* values rather than a
  single OFPC_FRAG_* value
* OFPC_FRAG_MASK is not a valid bitmap field

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:34:34 +09:00
Yuichi Ito
de7af3ace7 of14: set default attributes for meter-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:28:58 +09:00
Yuichi Ito
813ae5ed60 of13: set default attributes for meter-related classes
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:28:57 +09:00
FUJITA Tomonori
caeaae639b fix load_apps() in AppManager class
fix the following bug:

http://sourceforge.net/p/ryu/mailman/message/32022286/

Dependent services are not loaded properly with '_CONTEXTS'.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:25:30 +09:00
Wei-Li Tang
1875071ce2 six.add_metaclass requires six>=1.4.0
python-six package from Ubuntu 12.04 LTS remains version 1.1.0,
which prevents ryu-manager from being started and raises exception
"AttributeError: 'module' object has no attribute 'add_metaclass'".

Signed-off-by: Wei-Li Tang <alextwl@xinguard.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2014-03-04 13:21:38 +09:00
Simon Horman
9719958863 of14: Add experimenter property to port mod reply unit test
Signed-off-by: Simon Horman <horms@verge.net.au>
2014-02-27 22:30:08 +09:00