net-dhcp 1.3.2 → 1.3.3

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: 7591159786b80d0d7445de33a57b99a4f51a635b
4
- data.tar.gz: 575977fefba4c7a4dbe39d3e74a6c7e687fb9032
3
+ metadata.gz: 0b1ec4a4fafeff40ab5f44304c9aa8e784d86b15
4
+ data.tar.gz: 55e281d428786a2378a97f696234db7f5ade4e88
5
5
  SHA512:
6
- metadata.gz: 0143ba28710c7902233e3931d358a9df245c07592201d2ae3137edb4c68c675df2f6392187c338ed571c6e63ca89efca817cf92ed702cf0a8a7a3b26c972f080
7
- data.tar.gz: 8220cd139c0f5b967c1527c51a9473f26d184c496077561c5cc453a42fbc14d8805d4bd6974af4365d14778af85929cbb18ac22fa229f5a1710ed9affd2a629d
6
+ metadata.gz: 6e2de9ff05a904b8370c11f6007dd44fc5ae1c844b44888a98314ffb2b93cb115102bbf934c7fa586126b4efaffc57fbe28b9e96d565907bb20ec8f55223bac0
7
+ data.tar.gz: a548e3fca4140f97654ec0a8f5e51ad484177ac917e54ce4ec01f0726a6ac1686bfa4c686f03178f660113753939be4c4374306a0247d10d202596e1179779d0
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *1.3.3
2
+
3
+ * Add support for DHCP Subnet Selection Option 0x76 (https://github.com/mjtko/net-dhcp-ruby/pull/12) [elibus]
4
+
1
5
  *1.3.2
2
6
 
3
7
  * Fix MAC address sniffing under (at least) CentOS and RHEL 7 (also OS X and possibly FreeBSD)
@@ -1,5 +1,5 @@
1
1
  module Net
2
2
  module Dhcp
3
- VERSION = "1.3.2"
3
+ VERSION = "1.3.3"
4
4
  end
5
5
  end
@@ -148,8 +148,8 @@ $DHCP_END= 0xff
148
148
  $DHCP_CLIENTFQDN= 0x51 #rfc4702
149
149
 
150
150
 
151
- $DHCP_CLIENTARCH= 0x5d #rfc4578
152
- $DHCP_CLIENTARCH_I386= 0x0000
151
+ $DHCP_CLIENTARCH= 0x5d #rfc4578
152
+ $DHCP_CLIENTARCH_I386= 0x0000
153
153
  $DHCP_CLIENTARCH_PC98= 0x0001
154
154
  $DHCP_CLIENTARCH_ITANIUM= 0x0002
155
155
  $DHCP_CLIENTARCH_ALPHA= 0x0003
@@ -172,11 +172,11 @@ $DHCP_CLIENTARCH_NAMES = [
172
172
  'EFI x86-64',
173
173
  ]
174
174
 
175
- $DHCP_CLIENTNDI= 0x5e #rfc4578
176
- #$DHCP_LDAP= 0x5f
177
- $DHCP_UUIDGUID= 0x61 #rfc4578
178
-
179
- $DHCP_AUTOCONF= 0x74 #rfc2563
180
- $DHCP_AUTOCONF_NO= 0x00 #rfc2563
181
- $DHCP_AUTOCONF_YES= 0x01 #rfc2563
175
+ $DHCP_CLIENTNDI= 0x5e #rfc4578
176
+ #$DHCP_LDAP= 0x5f
177
+ $DHCP_UUIDGUID= 0x61 #rfc4578
182
178
 
179
+ $DHCP_AUTOCONF= 0x74 #rfc2563
180
+ $DHCP_SUBNET_SELECTION= 0x76 #rfc3011
181
+ $DHCP_AUTOCONF_NO= 0x00 #rfc2563
182
+ $DHCP_AUTOCONF_YES= 0x01 #rfc2563
@@ -555,6 +555,33 @@ module DHCP
555
555
  end
556
556
  end
557
557
 
558
+ # The subnet selection option is a DHCP option. The option contains a
559
+ # single IPv4 address that is the address of a subnet. The value for
560
+ # the subnet address is determined by taking any IPv4 address on the
561
+ # subnet and ANDing that address with the subnet mask (i.e.: the
562
+ # network and subnet bits are left alone and the remaining (address)
563
+ # bits are set to zero). When the DHCP server is configured to respond
564
+ # to this option, is allocating an address, and this option is present
565
+ # then the DHCP server MUST allocate the address on either:
566
+ # - the subnet specified in the subnet selection option, or;
567
+ #
568
+ # - a subnet on the same network segment as the subnet specified in the
569
+ # subnet selection option.
570
+ #
571
+ # The code for this option is 118, and its length is 4.
572
+ #
573
+ class SubnetSelectionOption < Option
574
+ def initialize(params={})
575
+ params[:type] = $DHCP_SUBNET_SELECTION
576
+ params[:payload] = params.fetch(:payload)
577
+ super(params)
578
+ end
579
+
580
+ def to_s()
581
+ "Subnet Selection = #{self.payload.join('.')}"
582
+ end
583
+ end
584
+
558
585
  $DHCP_MSG_OPTIONS = {
559
586
  $DHCP_SUBNETMASK => SubnetMaskOption,
560
587
  $DHCP_TIMEOFFSET => Option,
@@ -638,7 +665,7 @@ module DHCP
638
665
  $DHCP_LDAP => Option,
639
666
  $DHCP_UUIDGUID => UUIDGUIDOption,
640
667
  $DHCP_AUTOCONF => AutoConfigurationOption,
641
-
668
+ $DHCP_SUBNET_SELECTION => SubnetSelectionOption,
642
669
  }
643
670
 
644
671
  end
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.name = 'net-dhcp'
6
6
  s.version = Net::Dhcp::VERSION
7
7
  s.platform = Gem::Platform::RUBY
8
- s.date = "2014-11-18"
8
+ s.date = "2016-06-21"
9
9
  s.authors = ['daniel martin gomez (etd)', 'syonbori', 'Mark J. Titorenko']
10
10
  s.email = 'mark.titorenko@alces-software.com'
11
11
  s.homepage = 'http://github.com/mjtko/net-dhcp-ruby'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-dhcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - daniel martin gomez (etd)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-18 00:00:00.000000000 Z
13
+ date: 2016-06-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: 1.3.7
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.4.2
150
+ rubygems_version: 2.4.5.1
151
151
  signing_key:
152
152
  specification_version: 3
153
153
  summary: set of classes to low level handle the DHCP protocol