trema 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. data/Rakefile +1 -0
  2. data/Rantfile +14 -13
  3. data/features/example.openflow_message.echo.feature +59 -0
  4. data/features/{example.message.hello.feature → example.openflow_message.hello.feature} +0 -0
  5. data/ruby/trema/mac.rb +2 -0
  6. data/ruby/trema/set-eth-dst-addr.rb +3 -2
  7. data/ruby/trema/set-eth-src-addr.rb +3 -2
  8. data/ruby/trema/version.rb +1 -1
  9. data/spec/spec_helper.rb +1 -0
  10. data/spec/trema/set-eth-dst-addr_spec.rb +6 -0
  11. data/spec/trema/set-eth-src-addr_spec.rb +6 -0
  12. data/src/examples/openflow_message/{echo_request.c → echo.c} +12 -2
  13. data/src/examples/openflow_message/{echo-request.rb → echo.rb} +2 -2
  14. data/src/examples/openflow_switch/echo_switch.c +89 -0
  15. data/src/examples/openflow_switch/hello_switch.c +24 -20
  16. data/src/examples/simple_router/arp-table.rb +92 -0
  17. data/src/examples/simple_router/interface.rb +99 -0
  18. data/src/examples/simple_router/router-utils.rb +211 -0
  19. data/src/examples/simple_router/routing-table.rb +67 -0
  20. data/src/examples/simple_router/simple-router.rb +180 -0
  21. data/src/examples/simple_router/simple_router.conf +18 -0
  22. data/src/examples/simple_router/simple_router_netns.conf +15 -0
  23. data/src/examples/simple_router/simple_router_network.conf +6 -0
  24. data/src/tremashark/plugin/packet-trema/packet-trema.c +8 -8
  25. metadata +17 -11
  26. data/features/example.message.echo_reply.feature +0 -26
  27. data/features/example.message.echo_request.feature +0 -25
  28. data/src/examples/openflow_message/echo-reply.rb +0 -59
  29. data/src/examples/openflow_message/echo_reply.c +0 -70
@@ -1,59 +0,0 @@
1
- #
2
- # A test example program to send a configurable number of OFPT_ECHO_REPLY
3
- # messages.
4
- #
5
- # Author: Nick Karanatsios <nickkaranatsios@gmail.com>
6
- #
7
- # Copyright (C) 2008-2012 NEC Corporation
8
- #
9
- # This program is free software; you can redistribute it and/or modify
10
- # it under the terms of the GNU General Public License, version 2, as
11
- # published by the Free Software Foundation.
12
- #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU General Public License along
19
- # with this program; if not, write to the Free Software Foundation, Inc.,
20
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
- #
22
-
23
-
24
- require "example"
25
-
26
-
27
- class EchoReplyController < Controller
28
- include Example
29
-
30
-
31
- class << self
32
- def run args
33
- usage unless Example.options_parse args
34
- end
35
-
36
-
37
- def usage
38
- puts Example.cmd_usage
39
- puts "Send count number of echo replies to datapath_id."
40
- exit false
41
- end
42
- end
43
-
44
-
45
- def switch_ready msg_datapath_id
46
- may_raise_error msg_datapath_id
47
- send_nr_msgs EchoReply
48
- end
49
- end
50
-
51
-
52
- EchoReplyController.run ARGV
53
-
54
-
55
- ### Local variables:
56
- ### mode: Ruby
57
- ### coding: utf-8-unix
58
- ### indent-tabs-mode: nil
59
- ### End:
@@ -1,70 +0,0 @@
1
- /*
2
- * Sends echo_reply messages to the specified datapath ID.
3
- *
4
- * Author: Shin-ya Zenke, Yasuhito Takamiya <yasuhito@gmail.com>
5
- *
6
- * Copyright (C) 2008-2012 NEC Corporation
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License, version 2, as
10
- * published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along
18
- * with this program; if not, write to the Free Software Foundation, Inc.,
19
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
- */
21
-
22
-
23
- #include <inttypes.h>
24
- #include <stdio.h>
25
- #include "trema.h"
26
-
27
-
28
- void
29
- usage() {
30
- printf( "Usage: %s COUNT\n", get_executable_name() );
31
- }
32
-
33
-
34
- static void
35
- send_echo_replies( uint64_t datapath_id, void *count ) {
36
- for ( int i = 0; i < *( ( int * ) count ); i++ ) {
37
- buffer *echo_reply = create_echo_reply( get_transaction_id(), NULL );
38
- bool ret = send_openflow_message( datapath_id, echo_reply );
39
- if ( !ret ) {
40
- error( "Failed to send an echo reply message to the switch with datapath ID = %#" PRIx64 ".", datapath_id );
41
- }
42
- free_buffer( echo_reply );
43
- }
44
- }
45
-
46
-
47
- int
48
- main( int argc, char *argv[] ) {
49
- init_trema( &argc, &argv );
50
-
51
- if ( argc < 2 ) {
52
- usage();
53
- return -1;
54
- }
55
-
56
- int count = atoi( argv[ 1 ] );
57
- set_switch_ready_handler( send_echo_replies, &count );
58
-
59
- start_trema();
60
-
61
- return 0;
62
- }
63
-
64
-
65
- /*
66
- * Local variables:
67
- * c-basic-offset: 2
68
- * indent-tabs-mode: nil
69
- * End:
70
- */