pio 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/Gemfile +3 -2
- data/Guardfile +4 -1
- data/README.md +44 -6
- data/Rakefile +5 -23
- data/lib/pio.rb +15 -0
- data/lib/pio/arp.rb +31 -0
- data/lib/pio/arp/frame.rb +38 -0
- data/lib/pio/arp/message.rb +66 -0
- data/lib/pio/arp/reply.rb +55 -0
- data/lib/pio/arp/request.rb +55 -0
- data/lib/pio/ip.rb +90 -0
- data/lib/pio/lldp.rb +74 -12
- data/lib/pio/lldp/frame.rb +53 -4
- data/lib/pio/lldp/management-address-value.rb +7 -1
- data/lib/pio/lldp/optional-tlv.rb +3 -1
- data/lib/pio/lldp/organizationally-specific-value.rb +23 -0
- data/lib/pio/mac.rb +156 -0
- data/lib/pio/type/ethernet-header.rb +16 -0
- data/lib/pio/type/ip-address.rb +28 -0
- data/lib/pio/{lldp → type}/mac-address.rb +4 -3
- data/lib/pio/version.rb +1 -19
- data/pio.org +518 -0
- data/pio.org_archive +389 -0
- data/spec/pio/arp/reply_spec.rb +150 -0
- data/spec/pio/arp/request_spec.rb +131 -0
- data/spec/pio/arp_spec.rb +136 -0
- data/spec/pio/ip_spec.rb +38 -0
- data/spec/pio/lldp_spec.rb +195 -38
- data/spec/pio/mac_spec.rb +82 -0
- data/spec/spec_helper.rb +9 -0
- metadata +27 -17
- data/spec/pio/lldp/chassis-id-tlv_spec.rb +0 -27
- data/spec/pio/lldp/end-of-lldpdu-value_spec.rb +0 -20
- data/spec/pio/lldp/frame_spec.rb +0 -82
- data/spec/pio/lldp/mac-address_spec.rb +0 -20
- data/spec/pio/lldp/optional-tlv_spec.rb +0 -81
- data/spec/pio/lldp/port-id-tlv_spec.rb +0 -27
- data/spec/pio/lldp/ttl-tlv_spec.rb +0 -26
data/pio.org_archive
ADDED
@@ -0,0 +1,389 @@
|
|
1
|
+
Archived entries from file /Users/yasuhito/Dropbox/org/pio.org
|
2
|
+
|
3
|
+
|
4
|
+
* DONE gem を分離
|
5
|
+
CLOSED: [2013-08-02 金 10:36]
|
6
|
+
:LOGBOOK:
|
7
|
+
CLOCK: [2013-07-31 水 16:17]--[2013-07-31 水 23:05] => 6:48
|
8
|
+
CLOCK: [2013-07-31 水 15:32]--[2013-07-31 水 15:33] => 0:01
|
9
|
+
CLOCK: [2013-07-31 水 15:22]--[2013-07-31 水 15:32] => 0:10
|
10
|
+
CLOCK: [2013-07-31 水 14:59]--[2013-07-31 水 15:17] => 0:18
|
11
|
+
CLOCK: [2013-07-31 水 14:54]--[2013-07-31 水 14:58] => 0:04
|
12
|
+
CLOCK: [2013-07-31 水 14:14]--[2013-07-31 水 14:53] => 0:39
|
13
|
+
CLOCK: [2013-07-31 水 11:55]--[2013-07-31 水 12:11] => 0:16
|
14
|
+
CLOCK: [2013-07-31 水 11:33]--[2013-07-31 水 11:54] => 0:21
|
15
|
+
CLOCK: [2013-07-31 水 11:31]--[2013-07-31 水 11:33] => 0:02
|
16
|
+
CLOCK: [2013-07-31 水 11:27]--[2013-07-31 水 11:28] => 0:01
|
17
|
+
CLOCK: [2013-07-31 水 11:26]--[2013-07-31 水 11:27] => 0:01
|
18
|
+
CLOCK: [2013-07-31 水 11:21]--[2013-07-31 水 11:25] => 0:04
|
19
|
+
CLOCK: [2013-07-31 水 11:06]--[2013-07-31 水 11:07] => 0:01
|
20
|
+
:END:
|
21
|
+
:PROPERTIES:
|
22
|
+
:ARCHIVE_TIME: 2013-09-05 木 11:02
|
23
|
+
:ARCHIVE_FILE: ~/Dropbox/org/pio.org
|
24
|
+
:ARCHIVE_OLPATH: Research and Development/pio の開発
|
25
|
+
:ARCHIVE_CATEGORY: pio
|
26
|
+
:ARCHIVE_TODO: DONE
|
27
|
+
:ARCHIVE_ITAGS: pio
|
28
|
+
:END:
|
29
|
+
[2013-07-31 水 11:06]
|
30
|
+
** DONE 名前を決める
|
31
|
+
CLOSED: [2013-07-31 水 11:20] SCHEDULED: <2013-07-31 水>
|
32
|
+
:LOGBOOK:
|
33
|
+
CLOCK: [2013-07-31 水 11:09]--[2013-07-31 水 11:20] => 0:11
|
34
|
+
:END:
|
35
|
+
[2013-07-31 水 11:07]
|
36
|
+
** DONE pio リポジトリを作る
|
37
|
+
CLOSED: [2013-07-31 水 11:23] SCHEDULED: <2013-07-31 水>
|
38
|
+
:LOGBOOK:
|
39
|
+
CLOCK: [2013-07-31 水 11:20]--[2013-07-31 水 11:21] => 0:01
|
40
|
+
:END:
|
41
|
+
[2013-07-31 水 11:20]
|
42
|
+
** DONE Guard 対応にする
|
43
|
+
CLOSED: [2013-07-31 水 11:30] SCHEDULED: <2013-07-31 水>
|
44
|
+
:LOGBOOK:
|
45
|
+
CLOCK: [2013-07-31 水 11:28]--[2013-07-31 水 11:30] => 0:02
|
46
|
+
:END:
|
47
|
+
[2013-07-31 水 11:27]
|
48
|
+
** DONE Gemfile を作る
|
49
|
+
CLOSED: [2013-07-31 水 11:32] SCHEDULED: <2013-07-31 水>
|
50
|
+
:LOGBOOK:
|
51
|
+
CLOCK: [2013-07-31 水 11:30]--[2013-07-31 水 11:31] => 0:01
|
52
|
+
:END:
|
53
|
+
[2013-07-31 水 11:30]
|
54
|
+
** DONE paper-house/lib, spec 以下の bindata 関連を pio にコピー
|
55
|
+
CLOSED: [2013-07-31 水 11:54] SCHEDULED: <2013-07-31 水>
|
56
|
+
[2013-07-31 水 11:33]
|
57
|
+
** DONE 各モジュールを Pio:: とか Lldp:: とかに移動
|
58
|
+
CLOSED: [2013-07-31 水 14:09] SCHEDULED: <2013-07-31 水>
|
59
|
+
:LOGBOOK:
|
60
|
+
CLOCK: [2013-07-31 水 12:11]--[2013-07-31 水 12:14] => 0:03
|
61
|
+
CLOCK: [2013-07-31 水 11:54]--[2013-07-31 水 11:55] => 0:01
|
62
|
+
:END:
|
63
|
+
[2013-07-31 水 11:54]
|
64
|
+
** DONE reek タスクを追加
|
65
|
+
CLOSED: [2013-07-31 水 14:14] SCHEDULED: <2013-07-31 水>
|
66
|
+
:LOGBOOK:
|
67
|
+
CLOCK: [2013-07-31 水 14:09]--[2013-07-31 水 14:14] => 0:05
|
68
|
+
:END:
|
69
|
+
[2013-07-31 水 14:09]
|
70
|
+
** DONE reek の警告をつぶす
|
71
|
+
CLOSED: [2013-07-31 水 14:53] SCHEDULED: <2013-07-31 水>
|
72
|
+
- State "NEXT" from "HOLD" [2013-07-31 水 14:36]
|
73
|
+
- State "HOLD" from "NEXT" [2013-07-31 水 14:21] \\
|
74
|
+
ちょっと iOS のアップデートやる。
|
75
|
+
[2013-07-31 水 14:14]
|
76
|
+
** DONE flog タスクを追加
|
77
|
+
CLOSED: [2013-07-31 水 14:58] SCHEDULED: <2013-07-31 水>
|
78
|
+
:LOGBOOK:
|
79
|
+
CLOCK: [2013-07-31 水 14:53]--[2013-07-31 水 14:54] => 0:01
|
80
|
+
:END:
|
81
|
+
[2013-07-31 水 14:53]
|
82
|
+
** DONE flog の警告をつぶす
|
83
|
+
CLOSED: [2013-07-31 水 15:09] SCHEDULED: <2013-07-31 水>
|
84
|
+
:LOGBOOK:
|
85
|
+
CLOCK: [2013-07-31 水 14:58]--[2013-07-31 水 14:59] => 0:01
|
86
|
+
:END:
|
87
|
+
[2013-07-31 水 14:58]
|
88
|
+
** DONE flay タスクを追加
|
89
|
+
CLOSED: [2013-07-31 水 15:22] SCHEDULED: <2013-07-31 水>
|
90
|
+
:LOGBOOK:
|
91
|
+
CLOCK: [2013-07-31 水 15:17]--[2013-07-31 水 15:22] => 0:05
|
92
|
+
:END:
|
93
|
+
[2013-07-31 水 15:17]
|
94
|
+
|
95
|
+
* DONE gem の最低限の仕上げ
|
96
|
+
CLOSED: [2013-08-02 金 17:17]
|
97
|
+
:LOGBOOK:
|
98
|
+
CLOCK: [2013-08-02 金 11:35]--[2013-08-02 金 11:43] => 0:08
|
99
|
+
CLOCK: [2013-08-02 金 11:30]--[2013-08-02 金 11:35] => 0:05
|
100
|
+
CLOCK: [2013-08-02 金 10:55]--[2013-08-02 金 10:57] => 0:02
|
101
|
+
:END:
|
102
|
+
:PROPERTIES:
|
103
|
+
:ARCHIVE_TIME: 2013-09-05 木 11:02
|
104
|
+
:ARCHIVE_FILE: ~/Dropbox/org/pio.org
|
105
|
+
:ARCHIVE_OLPATH: Research and Development/pio の開発
|
106
|
+
:ARCHIVE_CATEGORY: pio
|
107
|
+
:ARCHIVE_TODO: DONE
|
108
|
+
:ARCHIVE_ITAGS: pio
|
109
|
+
:END:
|
110
|
+
[2013-08-02 金 10:36]
|
111
|
+
** DONE reek とか roodi とかそのへんやってくれる quality タスク
|
112
|
+
CLOSED: [2013-08-02 金 10:55] SCHEDULED: <2013-08-02 金>
|
113
|
+
[2013-07-31 水 11:26]
|
114
|
+
** DONE README.md をアップデート
|
115
|
+
CLOSED: [2013-08-02 金 17:15] SCHEDULED: <2013-08-02 金>
|
116
|
+
:LOGBOOK:
|
117
|
+
CLOCK: [2013-08-02 金 16:50]--[2013-08-02 金 16:51] => 0:01
|
118
|
+
CLOCK: [2013-08-02 金 15:25]--[2013-08-02 金 16:50] => 1:25
|
119
|
+
CLOCK: [2013-08-02 金 15:12]--[2013-08-02 金 15:25] => 0:13
|
120
|
+
CLOCK: [2013-08-02 金 14:27]--[2013-08-02 金 14:48] => 0:21
|
121
|
+
CLOCK: [2013-08-02 金 14:25]--[2013-08-02 金 14:27] => 0:02
|
122
|
+
CLOCK: [2013-08-02 金 14:11]--[2013-08-02 金 14:13] => 0:02
|
123
|
+
CLOCK: [2013-08-02 金 12:12]--[2013-08-02 金 14:11] => 1:59
|
124
|
+
CLOCK: [2013-08-02 金 12:05]--[2013-08-02 金 12:06] => 0:01
|
125
|
+
:END:
|
126
|
+
[2013-08-02 金 10:38]
|
127
|
+
*** DONE Code Climate のパッジを付ける
|
128
|
+
CLOSED: [2013-08-02 金 11:32] SCHEDULED: <2013-08-02 金>
|
129
|
+
:LOGBOOK:
|
130
|
+
CLOCK: [2013-08-02 金 11:29]--[2013-08-02 金 11:30] => 0:01
|
131
|
+
:END:
|
132
|
+
[2013-08-02 金 11:29]
|
133
|
+
*** DONE Travis のバッジを付ける
|
134
|
+
CLOSED: [2013-08-02 金 11:43] SCHEDULED: <2013-08-02 金>
|
135
|
+
[2013-08-02 金 11:35]
|
136
|
+
*** DONE Gem Version のバッジを付ける
|
137
|
+
CLOSED: [2013-08-02 金 11:45] SCHEDULED: <2013-08-02 金>
|
138
|
+
:LOGBOOK:
|
139
|
+
CLOCK: [2013-08-02 金 11:43]--[2013-08-02 金 11:45] => 0:02
|
140
|
+
:END:
|
141
|
+
[2013-08-02 金 11:43]
|
142
|
+
*** DONE Coveralls のバッジを付ける
|
143
|
+
CLOSED: [2013-08-02 金 12:05] SCHEDULED: <2013-08-02 金>
|
144
|
+
:LOGBOOK:
|
145
|
+
CLOCK: [2013-08-02 金 11:45]--[2013-08-02 金 12:05] => 0:20
|
146
|
+
:END:
|
147
|
+
[2013-08-02 金 11:45]
|
148
|
+
*** DONE Gemnasium のバッジを付ける
|
149
|
+
CLOSED: [2013-08-02 金 12:12] SCHEDULED: <2013-08-02 金>
|
150
|
+
:LOGBOOK:
|
151
|
+
CLOCK: [2013-08-02 金 12:06]--[2013-08-02 金 12:12] => 0:06
|
152
|
+
:END:
|
153
|
+
[2013-08-02 金 12:05]
|
154
|
+
*** DONE 簡単なサブセクションを埋める [6/6]
|
155
|
+
CLOSED: [2013-08-02 金 14:25] SCHEDULED: <2013-08-02 金>
|
156
|
+
:LOGBOOK:
|
157
|
+
CLOCK: [2013-08-02 金 14:13]--[2013-08-02 金 14:25] => 0:12
|
158
|
+
:END:
|
159
|
+
[2013-08-02 金 14:11]
|
160
|
+
|
161
|
+
- [X] Installation
|
162
|
+
- [X] Documents
|
163
|
+
- [X] Author
|
164
|
+
- [X] Contributors
|
165
|
+
- [X] Alternatives
|
166
|
+
- [X] License
|
167
|
+
|
168
|
+
*** DONE Example を追加
|
169
|
+
CLOSED: [2013-08-02 金 15:25] SCHEDULED: <2013-08-02 金>
|
170
|
+
[2013-08-02 金 14:27]
|
171
|
+
*** DONE Features Overview を追加
|
172
|
+
CLOSED: [2013-08-02 金 15:39] SCHEDULED: <2013-08-02 金>
|
173
|
+
[2013-08-02 金 15:25]
|
174
|
+
** DONE portability タスクを追加
|
175
|
+
CLOSED: [2013-08-02 金 11:29] SCHEDULED: <2013-08-02 金>
|
176
|
+
:LOGBOOK:
|
177
|
+
CLOCK: [2013-08-02 金 10:57]--[2013-08-02 金 11:29] => 0:32
|
178
|
+
:END:
|
179
|
+
[2013-08-02 金 10:57]
|
180
|
+
|
181
|
+
* CANCELED 0.2.0 リリース
|
182
|
+
CLOSED: [2013-09-05 木 11:06]
|
183
|
+
- State "CANCELED" from "TODO" [2013-09-05 木 11:06] \\
|
184
|
+
タスク階層を整理したので消す
|
185
|
+
:PROPERTIES:
|
186
|
+
:ID: 54B2B522-5469-446C-9A56-2AD48E3CCCD9
|
187
|
+
:ARCHIVE_TIME: 2013-09-05 木 11:06
|
188
|
+
:ARCHIVE_FILE: ~/Dropbox/org/pio.org
|
189
|
+
:ARCHIVE_OLPATH: Research and Development/pio の開発
|
190
|
+
:ARCHIVE_CATEGORY: pio
|
191
|
+
:ARCHIVE_TODO: CANCELED
|
192
|
+
:ARCHIVE_ITAGS: pio
|
193
|
+
:END:
|
194
|
+
[2013-08-02 金 17:16]
|
195
|
+
|
196
|
+
* CANCELED pio の開発 :pio:
|
197
|
+
CLOSED: [2013-09-05 木 11:06]
|
198
|
+
- State "CANCELED" from "TODO" [2013-09-05 木 11:06] \\
|
199
|
+
タスク階層を整理したので消す。
|
200
|
+
:PROPERTIES:
|
201
|
+
:ID: 68CB07BC-306C-47B9-B54F-D099C24DB772
|
202
|
+
:ARCHIVE_TIME: 2013-09-05 木 11:06
|
203
|
+
:ARCHIVE_FILE: ~/Dropbox/org/pio.org
|
204
|
+
:ARCHIVE_OLPATH: Research and Development
|
205
|
+
:ARCHIVE_CATEGORY: pio
|
206
|
+
:ARCHIVE_TODO: CANCELED
|
207
|
+
:END:
|
208
|
+
[2013-08-02 金 10:35]
|
209
|
+
|
210
|
+
* DONE 0.1.1 リリース
|
211
|
+
CLOSED: [2013-09-05 木 11:48]
|
212
|
+
:LOGBOOK:
|
213
|
+
CLOCK: [2013-09-05 木 11:38]--[2013-09-05 木 11:39] => 0:01
|
214
|
+
CLOCK: [2013-09-05 木 11:37]--[2013-09-05 木 11:38] => 0:01
|
215
|
+
:END:
|
216
|
+
:PROPERTIES:
|
217
|
+
:ARCHIVE_TIME: 2013-09-18 水 12:01
|
218
|
+
:ARCHIVE_FILE: ~/Dropbox/org/pio.org
|
219
|
+
:ARCHIVE_OLPATH: Research and Development
|
220
|
+
:ARCHIVE_CATEGORY: pio
|
221
|
+
:ARCHIVE_TODO: DONE
|
222
|
+
:ARCHIVE_ITAGS: PIO
|
223
|
+
:END:
|
224
|
+
[2013-09-05 木 11:12]
|
225
|
+
** DONE 古い gem 依存関係を直す
|
226
|
+
CLOSED: [2013-09-05 木 11:37] SCHEDULED: <2013-09-05 木>
|
227
|
+
:LOGBOOK:
|
228
|
+
CLOCK: [2013-09-05 木 11:16]--[2013-09-05 木 11:37] => 0:21
|
229
|
+
:END:
|
230
|
+
[2013-09-05 木 11:11]
|
231
|
+
** DONE リリース作業
|
232
|
+
CLOSED: [2013-09-05 木 11:48] SCHEDULED: <2013-09-05 木>
|
233
|
+
:LOGBOOK:
|
234
|
+
CLOCK: [2013-09-05 木 11:40]--[2013-09-05 木 11:48] => 0:08
|
235
|
+
CLOCK: [2013-09-05 木 11:39]--[2013-09-05 木 11:40] => 0:01
|
236
|
+
:END:
|
237
|
+
[2013-09-05 木 11:39]
|
238
|
+
|
239
|
+
- git flow でリリース
|
240
|
+
- gem を作ってアップロード
|
241
|
+
|
242
|
+
* フレームとパケットの違い
|
243
|
+
:LOGBOOK:
|
244
|
+
CLOCK: [2013-09-06 金 20:30]--[2013-09-06 金 20:31] => 0:01
|
245
|
+
:END:
|
246
|
+
:PROPERTIES:
|
247
|
+
:ARCHIVE_TIME: 2013-09-18 水 15:47
|
248
|
+
:ARCHIVE_FILE: ~/play/shunpio/pio.org
|
249
|
+
:ARCHIVE_OLPATH: Notes
|
250
|
+
:ARCHIVE_CATEGORY: pio
|
251
|
+
:ARCHIVE_ITAGS: PIO
|
252
|
+
:END:
|
253
|
+
[2013-09-06 金 20:30]
|
254
|
+
|
255
|
+
フレームは、Ethernet ヘッダからユーザデータ (L3-L7) までを含むデータを
|
256
|
+
さし、パケットは IP ヘッダ以降の L3-L7 までのデータをさす。
|
257
|
+
その意味で LLDP はフレーム。
|
258
|
+
|
259
|
+
ARPそのものは、L3レイヤで動作するのでパケットになるが、ルータから出たと
|
260
|
+
きは、EthernetFrame でカプセル化されるので、フレームになる
|
261
|
+
|
262
|
+
(近藤さん解説)
|
263
|
+
|
264
|
+
* DONE Pio の TODO を近藤さんと共有
|
265
|
+
CLOSED: [2013-09-06 金 20:45]
|
266
|
+
:LOGBOOK:
|
267
|
+
CLOCK: [2013-09-06 金 19:22]--[2013-09-06 金 19:23] => 0:01
|
268
|
+
:END:
|
269
|
+
:PROPERTIES:
|
270
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
271
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
272
|
+
:ARCHIVE_OLPATH: Tasks
|
273
|
+
:ARCHIVE_CATEGORY: pio
|
274
|
+
:ARCHIVE_TODO: DONE
|
275
|
+
:ARCHIVE_ITAGS: PIO
|
276
|
+
:END:
|
277
|
+
[2013-09-06 金 19:22]
|
278
|
+
そのまま GitHu にコミットしてしまう。
|
279
|
+
|
280
|
+
* DONE Guard の Emacs 通知が動くか試す
|
281
|
+
CLOSED: [2013-09-17 火 10:20] SCHEDULED: <2013-09-17 火>
|
282
|
+
:LOGBOOK:
|
283
|
+
CLOCK: [2013-09-17 火 09:59]--[2013-09-17 火 10:00] => 0:01
|
284
|
+
:END:
|
285
|
+
:PROPERTIES:
|
286
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
287
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
288
|
+
:ARCHIVE_OLPATH: Tasks
|
289
|
+
:ARCHIVE_CATEGORY: pio
|
290
|
+
:ARCHIVE_TODO: DONE
|
291
|
+
:ARCHIVE_ITAGS: PIO
|
292
|
+
:END:
|
293
|
+
[2013-09-17 火 09:59]
|
294
|
+
|
295
|
+
やっぱちゃんと動かない。深追いするのはとりあえずやめて、通知は tmux と
|
296
|
+
terminal_notifier だけにしとく。
|
297
|
+
|
298
|
+
* DONE ペアプロ環境を作る
|
299
|
+
CLOSED: [2013-09-05 木 17:16]
|
300
|
+
:LOGBOOK:
|
301
|
+
CLOCK: [2013-09-05 木 12:00]--[2013-09-05 木 12:16] => 0:16
|
302
|
+
:END:
|
303
|
+
:PROPERTIES:
|
304
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
305
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
306
|
+
:ARCHIVE_OLPATH: Tasks
|
307
|
+
:ARCHIVE_CATEGORY: pio
|
308
|
+
:ARCHIVE_TODO: DONE
|
309
|
+
:ARCHIVE_ITAGS: PIO
|
310
|
+
:END:
|
311
|
+
[2013-09-05 木 11:38]
|
312
|
+
|
313
|
+
どこかに tmux を使ったペアプロ環境構築法をメモっていたはず。
|
314
|
+
ここだ → http://www.zeespencer.com/articles/building-a-remote-pairing-setup/
|
315
|
+
** DONE ペアプロ設定のやりかたをざっと読む
|
316
|
+
CLOSED: [2013-09-05 木 12:00] SCHEDULED: <2013-09-05 木>
|
317
|
+
:LOGBOOK:
|
318
|
+
CLOCK: [2013-09-05 木 11:52]--[2013-09-05 木 12:00] => 0:08
|
319
|
+
:END:
|
320
|
+
[2013-09-05 木 11:51]
|
321
|
+
|
322
|
+
* DONE チャット履歴から TODO 追加もれがないか確認
|
323
|
+
CLOSED: [2013-09-06 金 20:41] SCHEDULED: <2013-09-06 金>
|
324
|
+
:LOGBOOK:
|
325
|
+
CLOCK: [2013-09-06 金 20:39]--[2013-09-06 金 20:41] => 0:02
|
326
|
+
CLOCK: [2013-09-06 金 20:31]--[2013-09-06 金 20:38] => 0:07
|
327
|
+
CLOCK: [2013-09-06 金 20:28]--[2013-09-06 金 20:30] => 0:02
|
328
|
+
:END:
|
329
|
+
:PROPERTIES:
|
330
|
+
:Effort: 0:15
|
331
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
332
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
333
|
+
:ARCHIVE_OLPATH: Tasks
|
334
|
+
:ARCHIVE_CATEGORY: pio
|
335
|
+
:ARCHIVE_TODO: DONE
|
336
|
+
:ARCHIVE_ITAGS: PIO
|
337
|
+
:END:
|
338
|
+
[2013-09-06 金 19:24]
|
339
|
+
|
340
|
+
* DONE 近藤さんとペアプロ
|
341
|
+
CLOSED: [2013-09-06 金 16:50] SCHEDULED: <2013-09-06 金 13:30-17:00>
|
342
|
+
:PROPERTIES:
|
343
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
344
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
345
|
+
:ARCHIVE_OLPATH: Special Dates
|
346
|
+
:ARCHIVE_CATEGORY: pio
|
347
|
+
:ARCHIVE_TODO: DONE
|
348
|
+
:ARCHIVE_ITAGS: PIO
|
349
|
+
:END:
|
350
|
+
[2013-09-06 金 12:14]
|
351
|
+
|
352
|
+
* DONE 近藤さんとペアプロ
|
353
|
+
CLOSED: [2013-09-06 金 13:14] SCHEDULED: <2013-09-06 金 11:00-12:00>
|
354
|
+
:PROPERTIES:
|
355
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
356
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
357
|
+
:ARCHIVE_OLPATH: Special Dates
|
358
|
+
:ARCHIVE_CATEGORY: pio
|
359
|
+
:ARCHIVE_TODO: DONE
|
360
|
+
:ARCHIVE_ITAGS: PIO
|
361
|
+
:END:
|
362
|
+
[2013-09-06 金 10:32]
|
363
|
+
|
364
|
+
* DONE 近藤さんとペアプロ
|
365
|
+
CLOSED: [2013-09-09 月 17:23] SCHEDULED: <2013-09-09 月 13:30-17:00>
|
366
|
+
:LOGBOOK:
|
367
|
+
CLOCK: [2013-09-09 月 17:13]--[2013-09-09 月 17:23] => 0:10
|
368
|
+
CLOCK: [2013-09-09 月 17:10]--[2013-09-09 月 17:13] => 0:03
|
369
|
+
CLOCK: [2013-09-09 月 15:58]--[2013-09-09 月 17:10] => 1:12
|
370
|
+
CLOCK: [2013-09-09 月 15:53]--[2013-09-09 月 15:58] => 0:05
|
371
|
+
CLOCK: [2013-09-09 月 15:26]--[2013-09-09 月 15:53] => 0:27
|
372
|
+
CLOCK: [2013-09-09 月 15:23]--[2013-09-09 月 15:26] => 0:03
|
373
|
+
CLOCK: [2013-09-09 月 14:27]--[2013-09-09 月 15:23] => 0:56
|
374
|
+
CLOCK: [2013-09-09 月 14:25]--[2013-09-09 月 14:27] => 0:02
|
375
|
+
CLOCK: [2013-09-09 月 14:19]--[2013-09-09 月 14:25] => 0:06
|
376
|
+
CLOCK: [2013-09-09 月 14:03]--[2013-09-09 月 14:19] => 0:16
|
377
|
+
CLOCK: [2013-09-09 月 13:54]--[2013-09-09 月 14:02] => 0:08
|
378
|
+
CLOCK: [2013-09-09 月 13:40]--[2013-09-09 月 13:54] => 0:14
|
379
|
+
CLOCK: [2013-09-09 月 10:22]--[2013-09-09 月 10:23] => 0:01
|
380
|
+
:END:
|
381
|
+
:PROPERTIES:
|
382
|
+
:ARCHIVE_TIME: 2013-09-19 木 14:02
|
383
|
+
:ARCHIVE_FILE: ~/play/pio/pio.org
|
384
|
+
:ARCHIVE_OLPATH: Special Dates
|
385
|
+
:ARCHIVE_CATEGORY: pio
|
386
|
+
:ARCHIVE_TODO: DONE
|
387
|
+
:ARCHIVE_ITAGS: PIO
|
388
|
+
:END:
|
389
|
+
[2013-09-09 月 10:22]
|
@@ -0,0 +1,150 @@
|
|
1
|
+
require File.join( File.dirname( __FILE__ ), "..", "..", "spec_helper" )
|
2
|
+
require "pio/arp/reply"
|
3
|
+
|
4
|
+
|
5
|
+
module Pio
|
6
|
+
class Arp
|
7
|
+
describe Reply do
|
8
|
+
context ".new" do
|
9
|
+
subject {
|
10
|
+
Arp::Reply.new(
|
11
|
+
:source_mac => source_mac,
|
12
|
+
:destination_mac => destination_mac,
|
13
|
+
:sender_protocol_address => sender_protocol_address,
|
14
|
+
:target_protocol_address => target_protocol_address
|
15
|
+
)
|
16
|
+
}
|
17
|
+
|
18
|
+
let( :arp_reply_dump ) {
|
19
|
+
[
|
20
|
+
0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1, # destination mac address
|
21
|
+
0x00, 0x16, 0x9d, 0x1d, 0x9c, 0xc4, # source mac address
|
22
|
+
0x08, 0x06, # ethernet type
|
23
|
+
0x00, 0x01, # arp hardware type
|
24
|
+
0x08, 0x00, # arp protocol type
|
25
|
+
0x06, # hardware address size
|
26
|
+
0x04, # protocol address size
|
27
|
+
0x00, 0x02, # operational code
|
28
|
+
0x00, 0x16, 0x9d, 0x1d, 0x9c, 0xc4, # sender hardware address
|
29
|
+
0xc0, 0xa8, 0x53, 0xfe, # sender protocol address
|
30
|
+
0x00, 0x26, 0x82, 0xeb, 0xea, 0xd1, # target hardware address
|
31
|
+
0xc0, 0xa8, 0x53, 0x03, # target protocol address
|
32
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # padding
|
33
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
34
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
35
|
+
0x00, 0x00, 0x00, 0x00,
|
36
|
+
].pack( "C*" )
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
context "with Integer MAC and IP address" do
|
41
|
+
let( :source_mac ) { 0x00169d1d9cc4 }
|
42
|
+
let( :destination_mac ) { 0x002682ebead1 }
|
43
|
+
let( :sender_protocol_address ) { 0xc0a853fe }
|
44
|
+
let( :target_protocol_address ) { 0xc0a85303 }
|
45
|
+
|
46
|
+
context "#to_binary" do
|
47
|
+
it "returns an Arp Reply binary String" do
|
48
|
+
expect( subject.to_binary ).to eq arp_reply_dump
|
49
|
+
end
|
50
|
+
|
51
|
+
it "returns a valid ether frame with size = 64" do
|
52
|
+
expect( subject.to_binary.size ).to eq 64
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
context "with String MAC and Integer IP address" do
|
59
|
+
let( :source_mac ) { "00:16:9d:1d:9c:c4" }
|
60
|
+
let( :destination_mac ) { "00:26:82:eb:ea:d1" }
|
61
|
+
let( :sender_protocol_address ) { 0xc0a853fe }
|
62
|
+
let( :target_protocol_address ) { 0xc0a85303 }
|
63
|
+
|
64
|
+
context "#to_binary" do
|
65
|
+
it "returns an Arp Reply binary String" do
|
66
|
+
expect( subject.to_binary ).to eq arp_reply_dump
|
67
|
+
end
|
68
|
+
|
69
|
+
it "returns a valid ether frame with size = 64" do
|
70
|
+
expect( subject.to_binary.size ).to eq 64
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
context "when Integer MAC and String IP address" do
|
77
|
+
let( :source_mac ) { 0x00169d1d9cc4 }
|
78
|
+
let( :destination_mac ) { 0x002682ebead1 }
|
79
|
+
let( :sender_protocol_address ) { "192.168.83.254" }
|
80
|
+
let( :target_protocol_address ) { "192.168.83.3" }
|
81
|
+
|
82
|
+
context "#to_binary" do
|
83
|
+
it "returns an Arp Reply binary String" do
|
84
|
+
expect( subject.to_binary ).to eq arp_reply_dump
|
85
|
+
end
|
86
|
+
|
87
|
+
it "returns a valid ether frame with size = 64" do
|
88
|
+
expect( subject.to_binary.size ).to eq 64
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
context "when :source_mac is not set" do
|
95
|
+
let( :source_mac ) { nil }
|
96
|
+
let( :destination_mac ) { 0x002682ebead1 }
|
97
|
+
let( :sender_protocol_address ) { "192.168.83.3" }
|
98
|
+
let( :target_protocol_address ) { "192.168.83.254" }
|
99
|
+
|
100
|
+
it "raises an invalid MAC address error" do
|
101
|
+
expect { subject }.to raise_error( "Invalid MAC address: nil" )
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
context "when :destination_mac is not set" do
|
107
|
+
let( :source_mac ) { 0x00169d1d9cc4 }
|
108
|
+
let( :destination_mac ) { nil }
|
109
|
+
let( :sender_protocol_address ) { "192.168.83.3" }
|
110
|
+
let( :target_protocol_address ) { "192.168.83.254" }
|
111
|
+
|
112
|
+
it "raises an invalid MAC address error" do
|
113
|
+
expect { subject }.to raise_error( "Invalid MAC address: nil" )
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
context "when :sender_protocol_address is not set" do
|
119
|
+
let( :source_mac ) { 0x00169d1d9cc4 }
|
120
|
+
let( :destination_mac ) { 0x002682ebead1 }
|
121
|
+
let( :sender_protocol_address ) { nil }
|
122
|
+
let( :target_protocol_address ) { "192.168.83.254" }
|
123
|
+
|
124
|
+
it "raises an invalid IP address error" do
|
125
|
+
expect { subject }.to raise_error( "Invalid IP address: nil" )
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
|
130
|
+
context "when :target_protocol_address is not set" do
|
131
|
+
let( :source_mac ) { 0x00169d1d9cc4 }
|
132
|
+
let( :destination_mac ) { 0x002682ebead1 }
|
133
|
+
let( :sender_protocol_address ) { "192.168.83.3" }
|
134
|
+
let( :target_protocol_address ) { nil }
|
135
|
+
|
136
|
+
it "raises an invalid IP address error" do
|
137
|
+
expect { subject }.to raise_error( "Invalid IP address: nil" )
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
|
146
|
+
### Local variables:
|
147
|
+
### mode: Ruby
|
148
|
+
### coding: utf-8-unix
|
149
|
+
### indent-tabs-mode: nil
|
150
|
+
### End:
|