Commit Graph

380 Commits

Author SHA1 Message Date
FUJITA Tomonori
5a0eea61fa packet lib: set protocol_name in each protocol
With this, it's easy to know the protocol name.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-06 13:16:15 +09:00
FUJITA Tomonori
5fd538ee7f packet lib: make Packet class iterator
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-06 13:16:13 +09:00
OHMURA Kei
9c30012955 packet lib: fix icmp echo serialize
Fix the merge breakage.

Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-05 23:37:18 +09:00
FUJITA Tomonori
9314fa4c64 packet lib: add mpls
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-05 19:00:32 +09:00
HIYAMA Manabu
7ad45aa1c1 test: fix unittests for of parser
- use bytearray(n) instead of str().zfill(n)
- test data are more strictly.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-05 18:57:59 +09:00
OHMURA Kei
12e9445c87 packet lib: add icmp.py
Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-04 10:59:24 +09:00
Isaku Yamahata
b624e6369b ofp_handler: print msg.data in hex format, not raw string
Printing raw string causes terminal in unexpected mode.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-03 05:24:06 +09:00
Isaku Yamahata
05a9c4d8f3 utils: a helper function to convert byte array into hex string
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-03 05:23:22 +09:00
Isaku Yamahata
0c3dd305c6 of1.0: fix/add PortMod message
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-03 05:22:18 +09:00
FUJITA Tomonori
94965a3b5b Removed leading '/' from data_files
This was preventing from creating a package on Windows machines where
there is no /etc/ folder.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-10-02 11:32:23 +09:00
FUJITA Tomonori
5483d98824 Ryu 1.3
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-30 21:58:41 +09:00
HIYAMA Manabu
fc264cc971 Fix zero padding
- zfill() is a func of the string to be putting in a '0'.
  bytearray().zfill(n) -> bytearray(n)

- unify notation of zero with other code.
  '\0' -> '\x00'

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-30 21:48:05 +09:00
HIYAMA Manabu
19c205b897 packet lib: fix vlan pcp bitshift
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-26 13:11:16 +09:00
HIYAMA Manabu
79e7d09cf0 packet lib: ipv4 option data support
also make checksum handling consistent with the other code.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-26 13:11:10 +09:00
HIYAMA Manabu
bb05f39c3a test: add more of1.2 integration tests
- some tests need attached port to switch.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-26 13:06:03 +09:00
YAMADA Hideki
09c70176ab packet lib: tcp option support
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-18 10:31:33 +09:00
FUJITA Tomonori
3cd6423a3f doc: fix typo in openstack.rst
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:48 +09:00
FUJITA Tomonori
83e53c5065 doc: rearrange top page
Rearrange the top page in the following way:

- Getting Started
- Cloud Integration (OpenStack only for now)
- Developing Your App

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:47 +09:00
FUJITA Tomonori
e1e85442ff doc: use README as getting_started
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:45 +09:00
FUJITA Tomonori
9b3246a630 doc: rename getting_started.rst -> parameters.rst
The 'getting_started' content overlaps with README. It also includes
more advanced information than 'getting_started'. This is preparation
for making README 'getting_started'.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-17 13:15:44 +09:00
FUJITA Tomonori
8b7950dc36 doc: rearrange openstack docs
The following docs are about OpenStack:

using_with_openstack.rst
step_by_step.rst
how_l2_segregation_work.rst

So let's create 'OpenStack' section in the index and put three under
the section.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-14 16:31:25 +09:00
FUJITA Tomonori
5e8d29832d doc: packet library
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-14 16:30:43 +09:00
Yoshihiro Kaneko
8f28a48a2a app/simple_isolation: update handler registration
This patch only removes unnecessary methods that didn't accord with
the library changed at ae0253a36c.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-12 12:37:59 +09:00
Hiyama Manabu
d26cbddf26 packet lib: fix ipv4 flags bitshift
Fixed flags bitshift.

Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-10 14:31:36 +09:00
FUJITA Tomonori
ae0253a36c simplify handler registration core
- we don't need register_cls() any more.
- register_instance() isn't called with dispatchers argument.
- set_ev_cls is always called with dispatchers argument.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-05 09:23:37 +09:00
FUJITA Tomonori
222d6f1fee register OFP handlers via register_instance
No reason that we use register_cls() for ofp handlers. We can do with
register_instance() with the others do.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-05 09:23:35 +09:00
FUJITA Tomonori
965c46a7a7 doc: integrate HACKING.rst into SubmittingPatches.rst
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-04 06:47:58 +09:00
FUJITA Tomonori
4d678d81a7 doc: rename SubmittingPatches to SubmittingPatches.rst
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-04 06:47:41 +09:00
FUJITA Tomonori
4dcda4e47e doc: convert SubmittingPatches into reST style
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-04 06:47:07 +09:00
FUJITA Tomonori
74b59f2fdb doc: update README.rst about migration from osrg.net
Migration from osrg.net finished. Update the links in README.rst.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-03 21:47:21 +09:00
FUJITA Tomonori
78c4822506 doc: set PYTHONPATH for ryu version constant
Fix the 6cc438c commit breakage.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-03 14:16:52 +09:00
FUJITA Tomonori
7e95ccb8e7 doc: write Ryu application
This is the first doc for someone who wants to write his Ryu
applicaiton.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-03 13:39:16 +09:00
FUJITA Tomonori
6cc438cb0e doc: use ryu version constant
- Use ryu version constant instead of setting the version by hand.
- update Copyright

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-02 09:29:50 +09:00
FUJITA Tomonori
ab1253e441 doc: change Sphinx style to haiku
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-09-02 09:29:47 +09:00
FUJITA Tomonori
0dc6d0c4f0 doc: fix the link in README.rst
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-31 21:54:19 +09:00
FUJITA Tomonori
d56ee9d19a Ryu 1.2
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-31 15:27:42 +09:00
FUJITA Tomonori
90021d43c1 remove OFPFlowRemoved and OFPPortStatus handlers in MAIN_DISPATCHER
I don't see any reason why we need to handle those two OFP messages as
differently as the rest.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-31 09:30:16 +09:00
FUJITA Tomonori
6e55bc8b98 remove unnecessary OFPFlowRemoved and OFPBarrierReply handlers in CONFIG_DISPATCHER
We don't send OFPC_DELETE OFPFlowMod or OFPBarrier during
CONFIG_DISPATCHER so we don't need OFPFlowRemoved and OFPBarrierReply.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-31 09:30:15 +09:00
FUJITA Tomonori
10fa798590 remove unnecessary OFPEchoReply handler in dispatchers
We don't send OFPEchoRequest so there is no point to have OFPEchoReply
handler.

I think that sending OFPEchoRequest is useful for some cases
(e.g. finding problems on the switch quickly). But that should be
another helper dispatcher since not all applications need such.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-31 09:29:57 +09:00
FUJITA Tomonori
05521398c1 packet lib: fix ipv4 option field handling
- fix the parser to set option data.
- add option argument to __init__.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-31 09:29:31 +09:00
FUJITA Tomonori
77df140ecf packet lib: set _MIN_LEN class variable
All protocols need to check if the data length is long enough so let's
set the minimum length in the same way.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-29 08:42:26 +09:00
FUJITA Tomonori
4d00bc8025 packet lib: add tcp support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
1241dafde4 packet lib: convert ip to use the checksum helper function
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
2814763bb8 packet lib: add udp data transmit and checksum support
- UDP supports sending data.
- UDP calculates the checksum if not given.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
0153f492ea packet lib: add packet_utils.py
Add a helper function to calculate the checksum.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
3fdb2dabec packet lib: add data serialize support to Packet class
This enables you to send data with Packet class.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
4e887d03c8 packet lib: calculate the udp length
If the length is not given, calculate it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
79ae375136 packet lib: calculate the ip total length
If the total length is not given, calculate it.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
d0cc259e3b packet lib: serialize in reverse order
- we need to serialize in reverse order since some need to know
  payload.
- TCP and UDP need the previous protocol info (IP) to calculate the
  checksum.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-28 05:58:25 +09:00
FUJITA Tomonori
b3e491349a of1.2: fix OFPFlowRemoved parser
Fix the following:

ryu/ofproto/ofproto_v1_2_parser.py", line 1701, in parser
    type_, length = struct.unpack_from('!HH', buf, offset)
TypeError: unpack_from() argument 1 must be string or read-only buffer, not bytearray

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2012-08-27 17:01:29 +09:00