100+ results for 'ipv6 lang:Ruby'
Not the results you expected?
network_fix_ipv6_test.rb (https://gitlab.com/thomasphillips3/vagrant) Ruby · 165 lines
2 require 'socket'
4 describe VagrantPlugins::ProviderVirtualBox::Action::NetworkFixIPv6 do
5 include_context "unit"
6 include_context "virtualbox"
36 end
38 context "with IPv6 interfaces" do
39 let(:socket) { double("socket") }
51 it "only checks the interfaces associated with the VM" do
52 all_networks = [{name: "vboxnet0",
53 ipv6: "dead:beef::",
54 ipv6_prefix: 64,
56 },
57 {name: "vboxnet1",
58 ipv6: "badd:badd::",
59 ipv6_prefix: 64,
base.rb (https://github.com/jeffbozek/whois.git) Ruby · 191 lines
mongodb_spec.rb (https://github.com/arunagw/backup.git) Ruby · 144 lines
17 db.port = 123
19 db.ipv6 = true
20 db.only_collections = ['users', 'pirates']
21 db.additional_options = ['--query']
87 end
89 describe '#ipv6' do
90 it 'should return a mongodb syntax compatible ipv6 flag' do
91 db.ipv6 = true
92 db.ipv6.should == '--ipv6'
93 end
95 it 'should return an empty string' do
96 db.ipv6 = nil
97 db.ipv6.should == ''
status_registered_spec.rb (https://github.com/priithaamer/whois.git) Ruby · 137 lines
124 @parser.nameservers[0].name.should == "ns1.nic.fr"
125 @parser.nameservers[0].ipv4.should == "192.93.0.1"
126 @parser.nameservers[0].ipv6.should == "2001:660:3005:1::1:1"
127 @parser.nameservers[1].should be_a(Whois::Record::Nameserver)
128 @parser.nameservers[1].name.should == "ns2.nic.fr"
129 @parser.nameservers[1].ipv4.should == "192.93.0.4"
130 @parser.nameservers[1].ipv6.should == "2001:660:3005:1::1:2"
131 @parser.nameservers[2].should be_a(Whois::Record::Nameserver)
132 @parser.nameservers[2].name.should == "ns3.nic.fr"
133 @parser.nameservers[2].ipv4.should == "192.134.0.49"
134 @parser.nameservers[2].ipv6.should == "2001:660:3006:1::1:1"
135 end
136 end
status_registered_spec.rb (https://github.com/doubledrones/whois.git) Ruby · 137 lines
124 subject.nameservers[0].name.should == "ns1.nic.fr"
125 subject.nameservers[0].ipv4.should == "192.93.0.1"
126 subject.nameservers[0].ipv6.should == "2001:660:3005:1::1:1"
127 subject.nameservers[1].should be_a(Whois::Record::Nameserver)
128 subject.nameservers[1].name.should == "ns2.nic.fr"
129 subject.nameservers[1].ipv4.should == "192.93.0.4"
130 subject.nameservers[1].ipv6.should == "2001:660:3005:1::1:2"
131 subject.nameservers[2].should be_a(Whois::Record::Nameserver)
132 subject.nameservers[2].name.should == "ns3.nic.fr"
133 subject.nameservers[2].ipv4.should == "192.134.0.49"
134 subject.nameservers[2].ipv6.should == "2001:660:3006:1::1:1"
135 end
136 end
mld.rb (https://github.com/sdaubert/packetgen.git) Ruby · 102 lines
28 # * a {#max_resp_delay} field ({Types::Int16} type),
29 # * a {#reserved} field ({Types::Int16} type),
30 # * a {#mcast_addr} field ({Header::IPv6::Addr} type),
31 # * and a {#body} (unused for MLDv1).
32 #
35 # mld = PacketGen::Header::MLD.new
36 # # in a packet
37 # pkt = PacketGen.gen('IPv6').add('ICMPv6').add('MLD')
38 # # access to MLD header
39 # pkt.mld # => PacketGen::Header::MLD
57 define_field :reserved, Types::Int16
58 # @!attribute mcast_addr
59 # IPv6 Multicast address
60 # @return [IPv6::Addr]
87 ipv6.next = 0
88 packet.insert(ipv6, 'IPv6::HopByHop', next: ICMPv6::IP_PROTOCOL)
89 packet.ipv6_hopbyhop.options << { type: 'router_alert', value: [0].pack('n') }
external_http.rb (https://gitlab.com/jacopo-beschi/gitlab-ce) Ruby · 101 lines
bind_php_ipv6.rb (https://bitbucket.org/cfield/metasploit-framework.git) Ruby · 87 lines
common_types.rb (https://github.com/juandebravo/bluevia-juan.git) Ruby · 166 lines
syn.rb (https://github.com/techpeace/metasploit-framework.git) Ruby · 126 lines
ack.rb (https://bitbucket.org/cfield/metasploit-framework.git) Ruby · 138 lines
interface.rb (https://github.com/lak/puppet-old.git) Ruby · 109 lines
default.rb (https://github.com/ClodoCorp/cookbook-bind.git) Ruby · 114 lines
mac_addresses_controller.rb (https://github.com/toyokazu/mac_address_manager.git) Ruby · 183 lines
merge_and_resolve_default_url_config_test.rb (https://github.com/subdigital/rails.git) Ruby · 424 lines
status_registered_spec.rb (https://gitlab.com/dandrews/whois.git) Ruby · 126 lines
113 expect(subject.nameservers[0].name).to eq("CNS1.SECURESERVER.NET")
114 expect(subject.nameservers[0].ipv4).to eq(nil)
115 expect(subject.nameservers[0].ipv6).to eq(nil)
116 expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
117 expect(subject.nameservers[1].name).to eq("CNS2.SECURESERVER.NET")
118 expect(subject.nameservers[1].ipv4).to eq(nil)
119 expect(subject.nameservers[1].ipv6).to eq(nil)
120 expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
121 expect(subject.nameservers[2].name).to eq("CNS3.SECURESERVER.NET")
122 expect(subject.nameservers[2].ipv4).to eq(nil)
123 expect(subject.nameservers[2].ipv6).to eq(nil)
124 end
125 end
status_registered_spec.rb (https://gitlab.com/dandrews/whois.git) Ruby · 168 lines
147 expect(subject.nameservers[0].name).to eq("dns5.registrar-servers.com")
148 expect(subject.nameservers[0].ipv4).to eq(nil)
149 expect(subject.nameservers[0].ipv6).to eq(nil)
150 expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
151 expect(subject.nameservers[1].name).to eq("dns3.registrar-servers.com")
152 expect(subject.nameservers[1].ipv4).to eq(nil)
153 expect(subject.nameservers[1].ipv6).to eq(nil)
154 expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
155 expect(subject.nameservers[2].name).to eq("dns2.registrar-servers.com")
156 expect(subject.nameservers[2].ipv4).to eq(nil)
157 expect(subject.nameservers[2].ipv6).to eq(nil)
158 expect(subject.nameservers[3]).to be_a(Whois::Record::Nameserver)
159 expect(subject.nameservers[3].name).to eq("dns1.registrar-servers.com")
middleware.rb (https://gitlab.com/KiaraGrouwstra/better_errors) Ruby · 142 lines
network_setting.rb (https://github.com/amooma/GS4.git) Ruby · 141 lines
ipcidr_spec.rb (https://gitlab.com/my-application.bjoernbartels.earth/application-base) Ruby · 67 lines
34 end
36 describe 'ipv6 address' do
37 before { @ipaddr = Puppet::Util::IPCidr.new('2001:db8:85a3:0:0:8a2e:370:7334') }
38 subject { @ipaddr }
42 end
44 describe 'single ipv6 addr with cidr' do
45 before { @ipaddr = Puppet::Util::IPCidr.new('2001:db8:85a3:0:0:8a2e:370:7334/128') }
46 subject { @ipaddr }
50 end
52 describe 'ipv6 addr range with cidr' do
53 before { @ipaddr = Puppet::Util::IPCidr.new('2001:db8:1234::/48') }
54 subject { @ipaddr }
test_binary.rb (git://github.com/mperham/dalli.git) Ruby · 121 lines
52 end
54 it 'handles ipv6 addresses' do
55 s = Dalli::Protocol::Binary.new('[::1]')
56 assert_equal '::1', s.hostname
60 end
62 it 'handles ipv6 addresses with port' do
63 s = Dalli::Protocol::Binary.new('[::1]:11212')
64 assert_equal '::1', s.hostname
68 end
70 it 'handles ipv6 addresses with port and weight' do
71 s = Dalli::Protocol::Binary.new('[::1]:11212:2')
72 assert_equal '::1', s.hostname
event_log_creation_test.rb (https://github.com/alphagov/signon.git) Ruby · 222 lines
reverse_ipv6_tcp.rb (https://bitbucket.org/cfield/metasploit-framework.git) Ruby · 70 lines
18 def self.handler_type_alias
19 "reverse_ipv6_tcp"
20 end
24 super(merge_info(info,
25 'Name' => 'Reverse TCP Stager (IPv6)',
26 'Description' => 'Connect back to the attacker over IPv6',
64 register_options(
65 [
66 OptInt.new("SCOPEID", [false, "The IPv6 Scope ID, required for link-layer addresses", 0])
67 ], self.class)
68 end
interface.rb (https://gitlab.com/gutocarvalho/puppet) Ruby · 82 lines
new_spec.rb (https://github.com/calavera/rubyspec.git) Ruby · 78 lines
disco_info_spec.rb (https://github.com/halorgium/blather.git) Ruby · 207 lines
187 describe 'Blather::Stanza::Iq::DiscoInfo::Feature' do
188 it 'will auto-inherit nodes' do
189 n = XML::Document.string "<feature var='ipv6' />"
190 i = Stanza::Iq::DiscoInfo::Feature.new n.root
191 i.var.must_equal 'ipv6'
203 a.must_respond_to :eql?
204 a.must_equal Blather::Stanza::Iq::DiscoInfo::Feature.new('var')
205 a.wont_equal "<feature var='ipv6' />"
206 end
207 end
status_registered_spec.rb (https://gitlab.com/dandrews/whois.git) Ruby · 113 lines
86 expect(subject.nameservers[0].name).to eq("ns1.google.com")
87 expect(subject.nameservers[0].ipv4).to eq(nil)
88 expect(subject.nameservers[0].ipv6).to eq(nil)
89 expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
90 expect(subject.nameservers[1].name).to eq("ns2.google.com")
91 expect(subject.nameservers[1].ipv4).to eq(nil)
92 expect(subject.nameservers[1].ipv6).to eq(nil)
93 expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
94 expect(subject.nameservers[2].name).to eq("ns3.google.com")
95 expect(subject.nameservers[2].ipv4).to eq(nil)
96 expect(subject.nameservers[2].ipv6).to eq(nil)
97 expect(subject.nameservers[3]).to be_a(Whois::Record::Nameserver)
98 expect(subject.nameservers[3].name).to eq("ns4.google.com")
default.rb (https://github.com/facebook/chef-cookbooks.git) Ruby · 70 lines
test_addrinfo.rb (https://github.com/shugo/jruby.git) Ruby · 219 lines
101 end
103 def test_ipv6?
104 getaddrs.each do |addr|
105 if addr.afamily == Socket::AF_INET6
113 # Travis CI's 'trusty' environment no longer has IP6 (travis-ci/travis-ci#4964)
114 unless ENV['TRAVIS']
115 def test_ipv6_loopback?
116 loopbacks = getaddrs.select do |addr|
117 if addr.afamily == Socket::AF_INET6
154 assert_equal( 0, sockaddr.bytes[1])
155 else
156 # TODO: (gf) test ipv6 addresses when Socket.unpack_sockaddr_in works for ipv6 and ipv6
157 if addr.ipv4?
158 assert_equal([addr.ip_port,addr.ip_address], Socket.unpack_sockaddr_in(sockaddr))
200 # def test_ipv6_mc_global? ; end
201 # def test_ipv6_mc_linklocal? ; end
202 # def test_ipv6_mc_nodelocal? ; end
EC2NetworkAclEntryIneffectiveDenyRule_spec.rb (https://github.com/stelligent/cfn_nag.git) Ruby · 54 lines
28 end
29 end
30 context 'EC2 Network ACL Entry uses a partial ipv6 CIDR range for a Deny rule' do
31 it 'returns the offending logical resource id' do
32 cfn_model = CfnParser.new.parse read_test_template(
33 'yaml/ec2_networkaclentry/ec2_networkaclentry_deny_partial_ipv6_cidr_range.yml'
34 )
40 end
41 end
42 context 'EC2 Network ACL Entry uses a full ipv6 CIDR range for a Deny rule' do
43 it 'returns an empty list' do
44 cfn_model = CfnParser.new.parse read_test_template(
status_registered_spec.rb (https://github.com/weppos/whois-parser.git) Ruby · 141 lines
128 expect(subject.nameservers[0].name).to eq("ns2.cdmon.es")
129 expect(subject.nameservers[0].ipv4).to eq(nil)
130 expect(subject.nameservers[0].ipv6).to eq(nil)
131 expect(subject.nameservers[1]).to be_a(Whois::Parser::Nameserver)
132 expect(subject.nameservers[1].name).to eq("ns3.cdmon.es")
133 expect(subject.nameservers[1].ipv4).to eq(nil)
134 expect(subject.nameservers[1].ipv6).to eq(nil)
135 expect(subject.nameservers[2]).to be_a(Whois::Parser::Nameserver)
136 expect(subject.nameservers[2].name).to eq("ns1.cdmon.es")
137 expect(subject.nameservers[2].ipv4).to eq(nil)
138 expect(subject.nameservers[2].ipv6).to eq(nil)
139 end
140 end
server_config_spec.rb (https://gitlab.com/my-application.bjoernbartels.earth/application-base) Ruby · 159 lines
50 end
52 describe 'with specific bind_ip values and ipv6' do
53 let(:pre_condition) { ["class mongodb::server { $config = '/etc/mongod.conf' $dbpath = '/var/lib/mongo' $rcfile = '/root/.mongorc.js' $ensure = present $bind_ip = ['127.0.0.1', 'fd00:beef:dead:55::143'] $ipv6 = true }", "include mongodb::server"]}
55 it {
56 is_expected.to contain_file('/etc/mongod.conf').with_content(/bind_ip\s=\s127\.0\.0\.1\,fd00:beef:dead:55::143/)
57 is_expected.to contain_file('/etc/mongod.conf').with_content(/ipv6=true/)
58 }
59 end
ipv6_spec.rb (git://github.com/todb/packetfu.git) Ruby · 81 lines
11 it "should contain sane defaults" do
12 expect(@ipv6_header.ipv6_v).to eql(6)
13 expect(@ipv6_header.ipv6_len).to eql(0)
53 expect(@ipv6_packet.payload).to eql("")
54 expect(@ipv6_packet.is_ipv6?).to be true
55 end
63 @ipv6_packet.recalc
64 expect(@ipv6_packet.ipv6_len).to eq(14)
66 @ipv6_packet.payload = "\0" * 255
76 @ipv6_packet.payload = "\xff" * 12
77 @ipv6_packet.ipv6_recalc(:ipv6_len)
78 expect(@ipv6_packet.ipv6_len).to eq(12)
getaddrinfo_spec.rb (https://github.com/koichiro/jruby.git) Ruby · 121 lines
24 expected = []
25 # The check for AP_INET6's class is needed because ipaddr.rb adds
26 # fake AP_INET6 even in case when IPv6 is not really supported.
27 # Without such check, this test might fail when ipaddr was required
28 # by some other specs.
93 it "accepts empty addresses for IPv6 passive sockets" do
94 res = Socket::getaddrinfo(nil, "http",
95 Socket::AF_INET6,
105 end
107 it "accepts empty addresses for IPv6 non-passive sockets" do
108 res = Socket::getaddrinfo(nil, "http",
109 Socket::AF_INET6,
test_acl.rb (https://gitlab.com/0072016/0072016-ruby) Ruby · 198 lines
server.rb (https://github.com/dylanegan/fog.git) Ruby · 225 lines
18 attribute :progress
19 attribute :accessIPv4
20 attribute :accessIPv6
21 attribute :state, :aliases => 'status'
22 attribute :created_at, :aliases => 'created'
182 'personality' => personality,
183 'accessIPv4' => accessIPv4,
184 'accessIPv6' => accessIPv6,
185 'min_count' => @min_count,
186 'max_count' => @max_count,
test-access-log-parser.rb (https://github.com/ranguba/racknga.git) Ruby · 303 lines
98 end
100 def ipv6_log_line
101 log_line("::1 - - #{time_log_component} " +
102 "\"GET / HTTP/1.1\" 200 613 \"-\" \"Ruby\"")
103 end
105 def ipv6_log_entry
106 options = {
107 :remote_address => "::1",
180 end
182 def test_ipv6_log
183 accesses = parse(join_lines(ipv6_log_line))
184 assert_equal([ipv6_log_entry],
185 accesses)
186 end
bind_tcp.rb (https://github.com/techpeace/metasploit-framework.git) Ruby · 206 lines
ngircd.rb (https://gitlab.com/0072016/homebrew-core) Ruby · 57 lines
miq-file_spec.rb (https://gitlab.com/aljesusg/manageiqtest) Ruby · 50 lines
ipcidr_spec.rb (https://bitbucket.org/joshcrawmer4/php-contact-form.git) Ruby · 96 lines
open-mpi.rb (https://bitbucket.org/bathtub/tigerbrew.git) Ruby · 56 lines
new_spec.rb (https://github.com/eregon/ruby.git) Ruby · 96 lines
fix-overtrusting_in_non_standard_http_header.rb (https://bitbucket.org/gibwar/moebooru) Ruby · 135 lines
shell_reverse_ipv6_tcp.rb (https://gitlab.com/0072016/metasploit-framework-rapid7) Ruby · 92 lines
19 def initialize(info = {})
20 super(merge_info(info,
21 'Name' => 'BSD x64 Command Shell, Reverse TCP Inline (IPv6)',
22 'Description' => 'Connect back to attacker and spawn a command shell over IPv6',
23 'Author' => 'Balazs Bucsay @xoreipeip <balazs.bucsay[-at-]rycon[-dot-]hu>',
24 'References' => ['URL', 'https://github.com/earthquake/shellcodes/blob/master/x86_64_bsd_ipv6_reverse_tcp.asm.c'],
25 'License' => MSF_LICENSE,
26 'Platform' => 'bsd',
78 "\x00\x1c\x11\x5c" +# AF_INET6+port #
79 "\x00\x00\x00\x00" +# no-one-cares #
80 "\x00\x00\x00\x00" +# IPv6- #
81 "\x00\x00\x00\x00" +# addr- #
82 "\x00\x00\x00\x00" +# in- #
86 ))
87 register_options([
88 OptInt.new('SCOPEID', [false, "IPv6 scope ID, for link-local addresses", 0])
89 ])
90 end
server_tests.rb (https://bitbucket.org/dievssoftware/fog.git) Ruby · 144 lines
firewallchain_spec.rb (https://bitbucket.org/schatt/puppetlabs-firewall.git) Ruby · 107 lines
28 'broute' => ['BROUTING']
29 }.each_pair do |table, allowedinternalchains|
30 ['IPv4', 'IPv6', 'ethernet'].each do |protocol|
31 [ 'test', '$5()*&%\'"^$09):' ].each do |chainname|
32 name = "#{chainname}:#{table}:#{protocol}"
33 if table == 'nat' && protocol == 'IPv6'
34 it "should fail #{name}" do
35 expect { resource[:name] = name }.to raise_error(Puppet::Error)
udp.rb (https://github.com/icewall/metasploit-framework.git) Ruby · 165 lines
rest_authconfig_spec.rb (https://github.com/lak/puppet-old.git) Ruby · 145 lines
test_rack_handler.rb (https://github.com/puma/puma.git) Ruby · 270 lines
php.rb (https://github.com/GunioRobot/deprec.git) Ruby · 99 lines
default.rb (https://gitlab.com/gitlab-cookbooks/gitlab-iptables) Ruby · 99 lines
mysql_grant_spec.rb (https://github.com/Dolibarr/obsolete.git) Ruby · 308 lines
189 end
190 end
191 it 'finds ipv6' do
192 shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'2607:f0d0:1002:0051:0000:0000:0000:0004'\"") do |r|
193 expect(r.stdout).to match(/GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'2607:f0d0:1002:0051:0000:0000:0000:0004'/)
195 end
196 end
197 it 'finds short ipv6' do
198 shell("mysql -NBe \"SHOW GRANTS FOR 'test'@'::1/128'\"") do |r|
199 expect(r.stdout).to match(/GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'::1\/128'/)
status_registered_spec.rb (https://github.com/weppos/whois-parser.git) Ruby · 90 lines
81 expect(subject.nameservers[0].name).to eq("ns1.google.com")
82 expect(subject.nameservers[0].ipv4).to eq(nil)
83 expect(subject.nameservers[0].ipv6).to eq(nil)
84 expect(subject.nameservers[1]).to be_a(Whois::Parser::Nameserver)
85 expect(subject.nameservers[1].name).to eq("ns2.google.com")
86 expect(subject.nameservers[1].ipv4).to eq(nil)
87 expect(subject.nameservers[1].ipv6).to eq(nil)
88 end
89 end
spec_helper_acceptance.rb (https://gitlab.com/tmountjr/vagrant-lamp) Ruby · 82 lines
8 c.filter_run :focus => true
9 c.run_all_when_everything_filtered = true
10 # apache on Ubuntu 10.04 and 12.04 doesn't like IPv6 VirtualHosts, so we skip ipv6 tests on those systems
11 if fact('operatingsystem') == 'Ubuntu' and (fact('operatingsystemrelease') == '10.04' or fact('operatingsystemrelease') == '12.04')
12 c.filter_run_excluding :ipv6 => true
ipv4_address.rb (https://github.com/pr0d1r2/ipv4_address.git) Ruby · 145 lines
9 LINK_LOCAL = ['169.254.0.0/16']
10 DOCUMENTATION = ['192.0.2.0/24', '198.51.100.0/24', '203.0.113.0/24']
11 IPV6_RELAY = ['192.88.99.0/24']
12 BENCHMARK = ['198.18.0.0/15']
13 MULTICAST = ['224.0.0.0/4']
73 end
75 def ipv6_relay?
76 exist_in_pool?(IPV6_RELAY)
77 end
79 def self.ipv6_relay?(addr)
80 begin
81 new(addr).ipv6_relay?
115 !link_local? &&
116 !documentation? &&
117 !ipv6_relay? &&
118 !benchmark? &&
119 !multicast?
new_spec.rb (https://github.com/abdollar/ruby.git) Ruby · 110 lines
9 end
11 it "initializes IPAddr ipv6 address with short notation" do
12 a = IPAddr.new
13 a.to_s.should == "::"
16 end
18 it "initializes IPAddr ipv6 address with long notation" do
19 a = IPAddr.new("0123:4567:89ab:cdef:0ABC:DEF0:1234:5678")
20 a.to_s.should == "123:4567:89ab:cdef:abc:def0:1234:5678"
23 end
25 it "initializes IPAddr ipv6 address with / subnet notation" do
26 a = IPAddr.new("3ffe:505:2::/48")
27 a.to_s.should == "3ffe:505:2::"
common_regular_expressions_spec.rb (https://github.com/andreazaupa/request-log-analyzer.git) Ruby · 80 lines
client_request_spec.rb (https://github.com/icewall/metasploit-framework.git) Ruby · 259 lines
meterpreter_reverse_ipv6_tcp.rb (https://github.com/asnild/meta.git) Ruby · 71 lines
26 super(merge_info(info,
27 'Name' => 'Windows Meterpreter Shell, Reverse TCP Inline (IPv6)',
28 'Description' => 'Connect back to attacker and spawn a Meterpreter shell',
29 'Author' => [ 'OJ Reeves' ],
38 OptString.new('EXTENSIONS', [false, 'Comma-separate list of extensions to load']),
39 OptString.new('EXTINIT', [false, 'Initialization strings for extensions']),
40 OptInt.new("SCOPEID", [false, "The IPv6 Scope ID, required for link-layer addresses", 0])
41 ], self.class)
42 end
56 expiration: datastore['SessionExpirationTimeout'].to_i,
57 uuid: opts[:uuid],
58 transports: [transport_config_reverse_ipv6_tcp(opts)],
59 extensions: (datastore['EXTENSIONS'] || '').split(','),
60 ext_init: (datastore['EXTINIT'] || '')
spectrum.rb (https://github.com/sisimai/rb-Sisimai.git) Ruby · 73 lines
21 1010 => 'rejected', # This email account has been blocked from sending emails due to suspicious activity.
22 1090 => 'systemerror', # The email you're trying to send can't be processed. Try sending again at a later time.
23 1260 => 'networkerror', # Spectrum doesn't process IPV6 addresses. Connect with an IPv4 address and try again.
24 1500 => 'rejected', # Your email was rejected for attempting to send as a different email address than you signed in under.
25 1520 => 'rejected', # Your email was rejected for attempting to send as a different email address than a domain that we host.
socks5.rb (https://github.com/marceldegraaf/webistrano.git) Ruby · 142 lines
700.060.20.110-cfg_dns_info_web.rb (https://github.com/DarrylBrown/main2.git) Ruby · 143 lines
whois.nic.ch.rb (git://github.com/weppos/whois.git) Ruby · 112 lines
snort.rb (https://github.com/mischumok/homebrew.git) Ruby · 52 lines
http_basic.rb (https://github.com/techpeace/metasploit-framework.git) Ruby · 116 lines
rebuild_server.rb (https://gitlab.com/debian-ruby/ruby-fog-rackspace) Ruby · 71 lines
5 # The rebuild operation removes all data on the server and replaces it with the specified image.
6 # The serverRef and all IP addresses remain the same. If you specify name, metadata, accessIPv4,
7 # or accessIPv6 in the rebuild request, new values replace existing values. Otherwise, these values do not change.
8 # @param [String] server_id id of the server to rebuild
9 # @param [String] image_id id of image used to rebuild the server
10 # @param [Hash] options
11 # @option options [String] accessIPv4 The IP version 4 address.
12 # @option options [String] accessIPv6 The IP version 6 address.
13 # @option options [String] adminPass The administrator password.
14 # @option options [Hash] metadata key value pairs of server metadata
windows_spec.rb (https://github.com/chef-cookbooks/firewall.git) Ruby · 30 lines
15 /firewall add rule name="duplicate1" description="same comment" dir=in protocol=tcp localip=any localport=1111 interfacetype=any remoteip=any remoteport=any action=allow/,
16 /firewall add rule name="duplicate1" description="same comment" dir=in protocol=tcp localip=any localport=5431,5432 interfacetype=any remoteip=any remoteport=any action=allow/,
17 /firewall add rule name="ipv6-source" description="ipv6-source" dir=in protocol=tcp localip=any localport=80 interfacetype=any remoteip=2001:db8::ff00:42:8329 remoteport=any action=allow/,
18 /firewall add rule name="range" description="range" dir=in protocol=tcp localip=any localport=1000-1100 interfacetype=any remoteip=any remoteport=any action=allow/,
19 /firewall add rule name="array" description="array" dir=in protocol=tcp localip=any localport=1234,5000-5100,5678 interfacetype=any remoteip=any remoteport=any action=allow/,
interface_types.rb (https://github.com/kabe/Lucie.git) Ruby · 130 lines
lynx.rb (https://github.com/Homebrew/linuxbrew-core.git) Ruby · 48 lines
ipaddress6_spec.rb (https://github.com/phantez/facter.git) Ruby · 36 lines
nodejs.rb (https://gitlab.com/alx741/metasploit-framework) Ruby · 70 lines
36 tls_hash = if use_ssl then '{rejectUnauthorized:false}, ' else '' end
37 net_lib = if use_ssl then 'tls' else 'net' end
38 lhost = Rex::Socket.is_ipv6?(lhost) ? "[#{datastore['LHOST']}]" : datastore['LHOST']
39 # the global.process.mainModule.constructor._load fallback for require() is
40 # handy when the payload is eval()'d into a sandboxed context: the reference
cares.rb (git://github.com/davidbalbert/eventless.git) Ruby · 146 lines
update_bundled_ca_certificates.rb (https://github.com/technicalpickles/rubygems.git) Ruby · 136 lines
helper.rb (https://gitlab.com/wilane/fluentd) Ruby · 141 lines
definition.rb (https://github.com/halvards/veewee.git) Ruby · 103 lines
net_http_wrappers.rb (git://github.com/newrelic/rpm.git) Ruby · 79 lines
mixins.rb (https://gitlab.com/leijianbin/metasploit-framework.git) Ruby · 101 lines
base.rb (https://gitlab.com/billhibadb/geolocal.git) Ruby · 193 lines
36 namefam = name.upcase + 'v4' if config[:ipv4]
37 elsif lofam == Socket::AF_INET6
38 namefam = name.upcase + 'v6' if config[:ipv6]
39 else
40 raise "unknown address family #{lofam} for #{lostr}"
58 results = countries.keys.reduce({}) { |a, k|
59 a.merge! k.upcase+'v4' => [] if config[:ipv4]
60 a.merge! k.upcase+'v6' => [] if config[:ipv6]
61 a
62 }
88 countries.keys.each do |name|
89 v4mod = config[:ipv4] ? name.to_s.upcase + 'v4' : 'nil'
90 v6mod = config[:ipv6] ? name.to_s.upcase + 'v6' : 'nil'
91 write_method file, name, v4mod, v6mod
92 end
candlepin_consumer_spec.rb (https://github.com/mbacovsky/katello.git) Ruby · 83 lines
22 "net.interface.eth2.ipv4_address" => "192.168.127.5",
23 "net.interface.eth2.netmask" => "255.255.255.0",
24 "net.interface.eth2.ipv6_address.link" => "fe80::1a03:73ff:fe44:6d94",
25 "net.interface.eth0.broadcast" => "123.123.123.123",
26 "net.interface.eth0.ipv4_address" => "192.168.127.4",
27 "net.interface.eth0.netmask" => "255.255.255.0",
28 "net.interface.eth0.ipv6_address.link" => "fe80::2a03:73ff:fe44:6d94",
29 "net.interface.em1.broadcast" => "123.123.123.123",
30 "net.interface.em1.ipv4_address" => "192.168.1.6",
31 "net.interface.em1.netmask" => "255.255.255.0",
32 "net.interface.em1.ipv6_address.link" => "fc80::2a03:73ff:fe44:6d94"
33 }
34 }
get_server.rb (https://gitlab.com/debian-ruby/ruby-fog-rackspace) Ruby · 63 lines
13 # * OS-EXT-STS:vm_state [String] - The VM state.
14 # * accessIPv4 [String] - The public IP version 4 access address.
15 # * accessIPv6 [String] - The public IP version 6 access address.
16 # * addresses [Hash] - Public and private IP addresses, The version field indicates whether the IP address is version 4 or 6.
17 # * created [String] - created timestamp
53 raise Fog::Compute::RackspaceV2::NotFound
54 else
55 server_response = Fog::Rackspace::MockData.keep(server, 'id', 'name', 'hostId', 'created', 'updated', 'status', 'progress', 'user_id', 'tenant_id', 'links', 'metadata', 'accessIPv4', 'accessIPv6', 'OS-DCF:diskConfig', 'rax-bandwidth:bandwidth', 'addresses', 'flavor', 'image')
56 server_response['image']['links'].map! { |l| l.delete("type"); l }
57 response(:body => {"server" => server_response})
header_spec.rb (https://github.com/sdaubert/packetgen.git) Ruby · 91 lines
resolv.rb (https://github.com/alexdalitz/dnsruby.git) Ruby · 127 lines
ancillary_data.rb (https://github.com/oracle/truffleruby.git) Ruby · 82 lines
httpbl_lookup.rb (https://bitbucket.org/cfield/metasploit-framework.git) Ruby · 98 lines
rebuild_server.rb (https://github.com/angusscown/fog.git) Ruby · 68 lines
6 # The rebuild operation removes all data on the server and replaces it with the specified image.
7 # The serverRef and all IP addresses remain the same. If you specify name, metadata, accessIPv4,
8 # or accessIPv6 in the rebuild request, new values replace existing values. Otherwise, these values do not change.
9 # @param [String] server_id id of the server to rebuild
10 # @param [String] image_id id of image used to rebuild the server
11 # @param [Hash] options
12 # @option options [String] accessIPv4 The IP version 4 address.
13 # @option options [String] accessIPv6 The IP version 6 address.
14 # @option options [String] adminPass The administrator password.
15 # @option options [Hash] metadata key value pairs of server metadata
helper.rb (https://github.com/chef-boneyard/opscode-omnibus.git) Ruby · 146 lines
15 end
17 # Normalizes hosts. If the host part is an ipv6 literal, then it
18 # needs to be quoted with []
19 def self.normalize_host(host_part)
20 # Make this simple: if ':' is detected at all, it is assumed
21 # to be a valid ipv6 address. We don't do data validation at this
22 # point, and ':' is only valid in an URL if it is quoted by brackets.
23 if host_part =~ /:/
ipv6.rb (https://github.com/brblck/mongo-ruby-driver.git) Ruby · 90 lines
dnsel_spec.rb (https://github.com/bendiken/tor-ruby.git) Ruby · 72 lines
cvmx-helper.c
(http://omnia2droid.googlecode.com/svn/trunk/)
C · 1059 lines
✨ Summary
This C code is part of a low-level interface for interacting with an Octeon processor’s peripherals, specifically its network interfaces (IPDs/PKOs). It provides functions to configure and manage these interfaces, including setting link states, loopback modes, and enabling/disabling internal and external loopbacks. The code interacts with the underlying hardware through system calls and registers.
This C code is part of a low-level interface for interacting with an Octeon processor’s peripherals, specifically its network interfaces (IPDs/PKOs). It provides functions to configure and manage these interfaces, including setting link states, loopback modes, and enabling/disabling internal and external loopbacks. The code interacts with the underlying hardware through system calls and registers.
206 port_config.s.mode = CVMX_HELPER_INPUT_PORT_SKIP_MODE;
208 tag_config.s.ip6_src_flag = CVMX_HELPER_INPUT_TAG_IPV6_SRC_IP;
209 tag_config.s.ip6_dst_flag = CVMX_HELPER_INPUT_TAG_IPV6_DST_IP;
210 tag_config.s.ip6_sprt_flag = CVMX_HELPER_INPUT_TAG_IPV6_SRC_PORT;
211 tag_config.s.ip6_dprt_flag = CVMX_HELPER_INPUT_TAG_IPV6_DST_PORT;
212 tag_config.s.ip6_nxth_flag = CVMX_HELPER_INPUT_TAG_IPV6_NEXT_HEADER;
213 tag_config.s.ip4_src_flag = CVMX_HELPER_INPUT_TAG_IPV4_SRC_IP;
214 tag_config.s.ip4_dst_flag = CVMX_HELPER_INPUT_TAG_IPV4_DST_IP;
miq_web_server_worker_mixin_spec.rb (https://gitlab.com/aljesusg/manageiqtest) Ruby · 83 lines
result.rb (https://github.com/mongodb/mongo-ruby-driver.git) Ruby · 128 lines
platform.rb (https://github.com/tronwarrior/chapter-admin.git) Ruby · 154 lines
flapper.rb (https://github.com/clarkf/flapjack.git) Ruby · 200 lines
130 :default_value => "/var/log/flapjack/flapper.log"
132 start.flag [:b, 'bind-ip'], :desc => 'ADDRESS (IPv4 or IPv6) for flapper to bind to',
133 :default_value => Flapjack::CLI::Flapper.local_ip
169 :default_value => "/var/log/flapjack/flapper.log"
171 restart.flag [:b, 'bind-ip'], :desc => 'ADDRESS (IPv4 or IPv6) for flapper to bind to',
172 :default_value => Flapjack::CLI::Flapper.local_ip
google_compute_subnetworks.rb (https://github.com/inspec/inspec-gcp.git) Ruby · 114 lines
35 filter_table_config.add(:secondary_ip_ranges, field: :secondary_ip_ranges)
36 filter_table_config.add(:private_ip_google_accesses, field: :private_ip_google_access)
37 filter_table_config.add(:private_ipv6_google_accesses, field: :private_ipv6_google_access)
38 filter_table_config.add(:regions, field: :region)
39 filter_table_config.add(:log_configs, field: :log_config)
88 'secondaryIpRanges' => ->(obj) { return :secondary_ip_ranges, GoogleInSpec::Compute::Property::SubnetworkSecondaryIpRangesArray.parse(obj['secondaryIpRanges'], to_s) },
89 'privateIpGoogleAccess' => ->(obj) { return :private_ip_google_access, obj['privateIpGoogleAccess'] },
90 'privateIpv6GoogleAccess' => ->(obj) { return :private_ipv6_google_access, obj['privateIpv6GoogleAccess'] },
91 'region' => ->(obj) { return :region, obj['region'] },
92 'logConfig' => ->(obj) { return :log_config, GoogleInSpec::Compute::Property::SubnetworkLogConfig.new(obj['logConfig'], to_s) },
rfc3986_parser.rb (https://github.com/abwinkler999/ruby.git) Ruby · 105 lines
3 # URI defined in RFC3986
4 # this regexp is modified not to host is not empty string
5 RFC3986_URI = /\A(?<URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
6 RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+)\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
79 SCHEME: /\A[A-Za-z][A-Za-z0-9+\-.]*\z/,
80 USERINFO: /\A(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*\z/,
81 HOST: /\A(?:(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{,4}::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])*))\z/,
82 ABS_PATH: /\A\/(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*(?:\/(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*)*\z/,
83 REL_PATH: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+(?:\/(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*)*\z/,
base.rb (https://github.com/michaelhidalgo/beef.git) Ruby · 188 lines
102 # @overload self.is_valid_ip?(version, ip)
103 # Checks if the given string is a valid IP address
104 # @param [Symbol] version IP version (either <code>:ipv4</code> or <code>:ipv6</code>)
105 # @param [String] ip string to be tested
106 # @return [Boolean] true if the string is a valid IP address, otherwise false
107 #
108 # @overload self.is_valid_ip?(ip)
109 # Checks if the given string is either a valid IPv4 or IPv6 address
110 # @param [String] ip string to be tested
111 # @return [Boolean] true if the string is a valid IPv4 or IPV6 address, otherwise false
118 ip =~ /^((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}
119 (25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$/x
120 when /^:ipv6$/
121 ip =~ /^(([0-9a-f]{1,4}:){7,7}[0-9a-f]{1,4}|
122 ([0-9a-f]{1,4}:){1,7}:|
shell_reverse_tcp_ipv6.rb (https://github.com/jduck/metasploit-framework.git) Ruby · 51 lines
19 def initialize(info = {})
20 super(merge_info(info,
21 'Name' => 'BSD Command Shell, Reverse TCP Inline (IPv6)',
22 'Description' => 'Connect back to attacker and spawn a command shell over IPv6',
45 ))
46 register_options([
47 OptInt.new('SCOPEID', [false, "IPv6 scope ID, for link-local addresses", 0])
48 ])
49 end