bgp4r 0.0.3 → 0.0.4
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.
- data/bgp/message.rb +7 -4
- data/bgp4r.gemspec +115 -0
- data/bgp4r.rb +26 -0
- data/examples/routegen.yml +5 -5
- metadata +5 -3
data/bgp/message.rb
CHANGED
@@ -24,11 +24,14 @@ require 'bgp/path_attribute'
|
|
24
24
|
require 'bgp/nlri'
|
25
25
|
require 'timeout'
|
26
26
|
|
27
|
-
class UnknownBGPCapability < RuntimeError
|
28
|
-
end
|
29
|
-
|
30
27
|
module BGP
|
31
28
|
|
29
|
+
class UnknownBgpCapability < RuntimeError
|
30
|
+
end
|
31
|
+
|
32
|
+
class UnknownBgpMessage < RuntimeError
|
33
|
+
end
|
34
|
+
|
32
35
|
module OPT_PARM
|
33
36
|
|
34
37
|
CAPABILITY = 2
|
@@ -111,7 +114,7 @@ module BGP
|
|
111
114
|
when CAP_ORF,CAP_ORF_CISCO
|
112
115
|
Orf_cap.new(s)
|
113
116
|
else
|
114
|
-
raise
|
117
|
+
raise UnknownBgpCapability, "Capability (#{code}), length: #{s.size} not implemented: [#{s.unpack('H*')[0]}]"
|
115
118
|
end
|
116
119
|
end
|
117
120
|
def to_hash(h={})
|
data/bgp4r.gemspec
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{bgp4r}
|
5
|
+
s.version = "0.0.4"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Jean-Michel Esnault"]
|
9
|
+
s.date = %q{2009-06-30}
|
10
|
+
s.description = %q{BGP4R is a BGP-4 ruby library to create, send, and receive BGP messages in an object oriented manner}
|
11
|
+
s.email = %q{jesnault@gmail.com}
|
12
|
+
s.extra_rdoc_files = [
|
13
|
+
"LICENSE.txt",
|
14
|
+
"README.rdoc"
|
15
|
+
]
|
16
|
+
s.files = [
|
17
|
+
"COPYING",
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc",
|
20
|
+
"bgp/aggregator.rb",
|
21
|
+
"bgp/as_path.rb",
|
22
|
+
"bgp/atomic_aggregate.rb",
|
23
|
+
"bgp/attribute.rb",
|
24
|
+
"bgp/attributes.rb",
|
25
|
+
"bgp/cluster_list.rb",
|
26
|
+
"bgp/common.rb",
|
27
|
+
"bgp/communities.rb",
|
28
|
+
"bgp/extended_communities.rb",
|
29
|
+
"bgp/extended_community.rb",
|
30
|
+
"bgp/iana.rb",
|
31
|
+
"bgp/io.rb",
|
32
|
+
"bgp/label.rb",
|
33
|
+
"bgp/local_pref.rb",
|
34
|
+
"bgp/message.rb",
|
35
|
+
"bgp/mp_reach.rb",
|
36
|
+
"bgp/multi_exit_disc.rb",
|
37
|
+
"bgp/neighbor.rb",
|
38
|
+
"bgp/next_hop.rb",
|
39
|
+
"bgp/nlri.rb",
|
40
|
+
"bgp/orf.rb",
|
41
|
+
"bgp/origin.rb",
|
42
|
+
"bgp/originator_id.rb",
|
43
|
+
"bgp/path_attribute.rb",
|
44
|
+
"bgp/prefix_orf.rb",
|
45
|
+
"bgp/rd.rb",
|
46
|
+
"bgp4r.gemspec",
|
47
|
+
"bgp4r.rb",
|
48
|
+
"examples/bgp",
|
49
|
+
"examples/routegen",
|
50
|
+
"examples/routegen.yml",
|
51
|
+
"test/aggregator_test.rb",
|
52
|
+
"test/as_path_test.rb",
|
53
|
+
"test/atomic_aggregate_test.rb",
|
54
|
+
"test/attribute_test.rb",
|
55
|
+
"test/cluster_list_test.rb",
|
56
|
+
"test/common_test.rb",
|
57
|
+
"test/communities_test.rb",
|
58
|
+
"test/extended_communities_test.rb",
|
59
|
+
"test/extended_community_test.rb",
|
60
|
+
"test/label_test.rb",
|
61
|
+
"test/local_pref_test.rb",
|
62
|
+
"test/message_test.rb",
|
63
|
+
"test/mp_reach_test.rb",
|
64
|
+
"test/multi_exit_disc_test.rb",
|
65
|
+
"test/neighbor_test.rb",
|
66
|
+
"test/next_hop_test.rb",
|
67
|
+
"test/nlri_test.rb",
|
68
|
+
"test/origin_test.rb",
|
69
|
+
"test/originator_id_test.rb",
|
70
|
+
"test/path_attribute_test.rb",
|
71
|
+
"test/prefix_orf_test.rb",
|
72
|
+
"test/rd_test.rb"
|
73
|
+
]
|
74
|
+
s.homepage = %q{http://github.com/jesnault/bgp4r/tree/master}
|
75
|
+
s.rdoc_options = ["--quiet", "--title", "A BGP-4 Ruby Library", "--line-numbers"]
|
76
|
+
s.require_paths = ["."]
|
77
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
|
78
|
+
s.rubyforge_project = %q{bgp4r}
|
79
|
+
s.rubygems_version = %q{1.3.4}
|
80
|
+
s.summary = %q{A BGP-4 Ruby Library}
|
81
|
+
s.test_files = [
|
82
|
+
"test/aggregator_test.rb",
|
83
|
+
"test/as_path_test.rb",
|
84
|
+
"test/atomic_aggregate_test.rb",
|
85
|
+
"test/attribute_test.rb",
|
86
|
+
"test/cluster_list_test.rb",
|
87
|
+
"test/common_test.rb",
|
88
|
+
"test/communities_test.rb",
|
89
|
+
"test/extended_communities_test.rb",
|
90
|
+
"test/extended_community_test.rb",
|
91
|
+
"test/label_test.rb",
|
92
|
+
"test/local_pref_test.rb",
|
93
|
+
"test/message_test.rb",
|
94
|
+
"test/mp_reach_test.rb",
|
95
|
+
"test/multi_exit_disc_test.rb",
|
96
|
+
"test/neighbor_test.rb",
|
97
|
+
"test/next_hop_test.rb",
|
98
|
+
"test/nlri_test.rb",
|
99
|
+
"test/origin_test.rb",
|
100
|
+
"test/originator_id_test.rb",
|
101
|
+
"test/path_attribute_test.rb",
|
102
|
+
"test/prefix_orf_test.rb",
|
103
|
+
"test/rd_test.rb"
|
104
|
+
]
|
105
|
+
|
106
|
+
if s.respond_to? :specification_version then
|
107
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
108
|
+
s.specification_version = 3
|
109
|
+
|
110
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
111
|
+
else
|
112
|
+
end
|
113
|
+
else
|
114
|
+
end
|
115
|
+
end
|
data/bgp4r.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright 2008, 2009 Jean-Michel Esnault.
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE.txt for permissions.
|
5
|
+
#
|
6
|
+
#
|
7
|
+
# This file is part of BGP4R.
|
8
|
+
#
|
9
|
+
# BGP4R is free software: you can redistribute it and/or modify
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
12
|
+
# (at your option) any later version.
|
13
|
+
#
|
14
|
+
# BGP4R is distributed in the hope that it will be useful,
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# GNU General Public License for more details.
|
18
|
+
#
|
19
|
+
# You should have received a copy of the GNU General Public License
|
20
|
+
# along with BGP4R. If not, see <http://www.gnu.org/licenses/>.
|
21
|
+
#++
|
22
|
+
|
23
|
+
require 'bgp/common'
|
24
|
+
require 'bgp/io'
|
25
|
+
require 'bgp/neighbor'
|
26
|
+
require 'bgp/message'
|
data/examples/routegen.yml
CHANGED
@@ -5,16 +5,16 @@ neighbor:
|
|
5
5
|
router id: 1.1.1.1
|
6
6
|
my as: 100
|
7
7
|
holdtime: 180
|
8
|
-
local address:
|
9
|
-
neighbor address:
|
8
|
+
local address: 199.0.0.5
|
9
|
+
neighbor address: 199.0.0.6
|
10
10
|
capabilities:
|
11
11
|
- four byte as
|
12
12
|
routes:
|
13
13
|
nlris: 11.0.0.0/28, 1999, 127
|
14
|
-
next hop:
|
14
|
+
next hop: 199.0.0.5
|
15
15
|
local pref: 100
|
16
16
|
med: 100
|
17
|
-
origin:
|
17
|
+
origin: 0
|
18
18
|
communities: 100:1 200:1 300:1
|
19
19
|
as path: 200 300 400 500
|
20
20
|
|
@@ -27,7 +27,7 @@ bgp 100 0 1999 107946 287856
|
|
27
27
|
ios#
|
28
28
|
|
29
29
|
ios#show ip bgp ipv4 unicast
|
30
|
-
BGP table version is 13995, local router ID is
|
30
|
+
BGP table version is 13995, local router ID is 2.2.2.2
|
31
31
|
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
|
32
32
|
r RIB-failure
|
33
33
|
Origin codes: i - IGP, e - EGP, ? - incomplete
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bgp4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Michel Esnault
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-30 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -52,6 +52,8 @@ files:
|
|
52
52
|
- bgp/path_attribute.rb
|
53
53
|
- bgp/prefix_orf.rb
|
54
54
|
- bgp/rd.rb
|
55
|
+
- bgp4r.gemspec
|
56
|
+
- bgp4r.rb
|
55
57
|
- examples/bgp
|
56
58
|
- examples/routegen
|
57
59
|
- examples/routegen.yml
|
@@ -104,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
106
|
requirements: []
|
105
107
|
|
106
108
|
rubyforge_project: bgp4r
|
107
|
-
rubygems_version: 1.3.
|
109
|
+
rubygems_version: 1.3.5
|
108
110
|
signing_key:
|
109
111
|
specification_version: 3
|
110
112
|
summary: A BGP-4 Ruby Library
|