openflow-protocol 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76e227849a8eae5169563c4eb8277c48f36db0fe
4
- data.tar.gz: 22e803bb2af8788d5bbd965199e9e435bfc14e92
3
+ metadata.gz: 6f94f99229202cb215a3f45a313482fbb6cdcc49
4
+ data.tar.gz: f589adaeefa69fae98b395c965f07f65dad69386
5
5
  SHA512:
6
- metadata.gz: 552d6895c2659e16d0fe8d4602e354a4fc260d394ef2fb75069af604a5bc1677addeb276657e5922e89b079d62ff76d65fcc23c4ef4164b49becddfb11113e27
7
- data.tar.gz: d91c5997c0cbe098ef9646d1f3cf01a059657bf2f0bf1781b3dc7e0dca43dfb27bff72b48b0bc1e3108674ec1fe7d0d8d35d1a475a6639d77b312e8a357021e4
6
+ metadata.gz: b3e13558a40cace4eee9e59a3524cf0f8fcc681f34c6cd35222c26a8ddbe4b0f6d434a0039613a2f0728a8975e73b075e051b920dff2047e67fdd55d564ca080
7
+ data.tar.gz: f7724e7856d1cbd5390a93d8155922d07b902479971f133e76c05db5e214eb34662d604e0e53b1b7363881999ab892e79c5e4917c09d99c1ff16d309fe06b969
@@ -0,0 +1,61 @@
1
+ require_relative 'message'
2
+
3
+ class OFError < OFMessage
4
+ TYPES = [
5
+ :hello_failed,
6
+ :bad_request,
7
+ :bad_action,
8
+ :flow_mod_failed,
9
+ :port_mod_failed,
10
+ :queue_op_failed
11
+ ]
12
+ HELLO_FAILED_CODES = [:incompatible, :eperm]
13
+ BAD_REQUEST_CODES = [
14
+ :bad_version,
15
+ :bad_type,
16
+ :bad_stat,
17
+ :bad_vendor,
18
+ :bad_sub_type,
19
+ :eperm,
20
+ :bad_length,
21
+ :buffer_empty,
22
+ :buffer_unknown
23
+ ]
24
+ BAD_ACTION_CODES = [
25
+ :bad_type,
26
+ :bad_length,
27
+ :bad_vendor,
28
+ :bad_vendor_type,
29
+ :bad_out_port,
30
+ :bad_argument,
31
+ :eperm,
32
+ :too_many,
33
+ :bad_queue
34
+ ]
35
+ FLOW_MOD_FAILED_CODES = [
36
+ :all_tables_full,
37
+ :overlap,
38
+ :eperm,
39
+ :bad_emerg_timeout,
40
+ :bad_command,
41
+ :unsupported
42
+ ]
43
+ PORT_MOD_FAILED_CODES = [:bad_port, :bad_hardware_address]
44
+ QUEUE_OP_FAILED_CODES = [:bad_port, :bad_queue, :eperm]
45
+
46
+ enum16 :error_type, list: TYPES
47
+ choice :error_code, selection: -> { error_type.to_s } do
48
+ enum16 'hello_failed', list: HELLO_FAILED_CODES
49
+ enum16 'bad_request', list: BAD_REQUEST_CODES
50
+ enum16 'bad_action', list: BAD_ACTION_CODES
51
+ enum16 'flow_mod_failed', list: FLOW_MOD_FAILED_CODES
52
+ enum16 'port_mod_failed', list: PORT_MOD_FAILED_CODES
53
+ enum16 'queue_op_failed', list: QUEUE_OP_FAILED_CODES
54
+ uint16 :default
55
+ end
56
+ rest :data
57
+
58
+ def body_length
59
+ 4 + data.length
60
+ end
61
+ end
@@ -15,7 +15,7 @@ class OFMessage < SuperclassBase
15
15
  HEADER_LENGTH = 8
16
16
  TYPES = [
17
17
  :hello,
18
- :error, # TODO
18
+ :error,
19
19
  :echo_request,
20
20
  :echo_reply,
21
21
  :vendor,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openflow-protocol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy Pagé
@@ -65,6 +65,7 @@ files:
65
65
  - lib/messages/barrier_request.rb
66
66
  - lib/messages/echo_reply.rb
67
67
  - lib/messages/echo_request.rb
68
+ - lib/messages/error.rb
68
69
  - lib/messages/features_reply.rb
69
70
  - lib/messages/features_request.rb
70
71
  - lib/messages/flow_mod.rb