dhcpsapi 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.
@@ -0,0 +1,38 @@
1
+ module DhcpsApi::Win2008
2
+ module Class
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DhcpEnumClasses(
9
+ _In_ LPWSTR ServerIpAddress,
10
+ _In_ DWORD ReservedMustBeZero,
11
+ _Inout_ DHCP_RESUME_HANDLE *ResumeHandle,
12
+ _In_ DWORD PreferredMaximum,
13
+ _Out_ LPDHCP_CLASS_INFO_ARRAY *ClassInfoArray,
14
+ _Out_ DWORD *nRead,
15
+ _Out_ DWORD *nTotal
16
+ );
17
+ =end
18
+ attach_function :DhcpEnumClasses, [:pointer, :uint32, :pointer, :uint32, :pointer, :pointer, :pointer], :uint32
19
+
20
+ =begin
21
+ DWORD DhcpCreateClass(
22
+ _In_ LPWSTR ServerIpAddress,
23
+ _In_ DWORD ReservedMustBeZero,
24
+ _In_ LPDHCP_CLASS_INFO ClassInfo
25
+ );
26
+ =end
27
+ attach_function :DhcpCreateClass, [:pointer, :uint32, :pointer], :uint32
28
+
29
+ =begin
30
+ DWORD DhcpDeleteClass(
31
+ _In_ LPWSTR ServerIpAddress,
32
+ _In_ DWORD ReservedMustBeZero,
33
+ _In_ LPWSTR ClassName
34
+ );
35
+ =end
36
+ attach_function :DhcpDeleteClass, [:pointer, :uint32, :pointer], :uint32
37
+ end
38
+ end
@@ -0,0 +1,41 @@
1
+ module DhcpsApi::Win2008
2
+ module Client
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DhcpCreateClientInfoV4(
9
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
10
+ _In_ LPDHCP_CONST DHCP_CLIENT_INFO_V4 ClientInfo
11
+ );
12
+ =end
13
+ attach_function :DhcpCreateClientInfoV4, [:pointer, :pointer], :uint32
14
+
15
+ =begin
16
+ DWORD DhcpSetClientInfoV4(
17
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
18
+ _In_ DHCP_CONST DHCP_CLIENT_INFO_V4 *ClientInfo
19
+ );
20
+ =end
21
+ attach_function :DhcpSetClientInfoV4, [:pointer, :pointer], :uint32
22
+
23
+ =begin
24
+ DWORD DHCP_API_FUNCTION DhcpGetClientInfoV4(
25
+ _In_ DHCP_CONST WCHAR ServerIpAddress,
26
+ _In_ DHCP_CONST DHCP_SEARCH_INFO SearchInfo,
27
+ _Out_ LPDHCP_CLIENT_INFO_V4 *ClientInfo
28
+ );
29
+ =end
30
+ attach_function :DhcpGetClientInfoV4, [:pointer, DhcpsApi::DHCP_SEARCH_INFO.by_value, :pointer], :uint32
31
+
32
+
33
+ =begin
34
+ DWORD DHCP_API_FUNCTION DhcpDeleteClientInfo(
35
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
36
+ _In_ DHCP_CONST DHCP_SEARCH_INFO *ClientInfo
37
+ );
38
+ =end
39
+ attach_function :DhcpDeleteClientInfo, [:pointer, :pointer], :uint32
40
+ end
41
+ end
@@ -0,0 +1,14 @@
1
+ module DhcpsApi::Win2008
2
+ module Common
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ VOID DHCP_API_FUNCTION DhcpRpcFreeMemory(
9
+ PVOID BufferPointer
10
+ );
11
+ =end
12
+ attach_function :DhcpRpcFreeMemory, [:pointer], :void
13
+ end
14
+ end
@@ -0,0 +1,57 @@
1
+ module DhcpsApi::Win2008
2
+ module Option
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DhcpCreateOptionV5(
9
+ _In_ LPWSTR ServerIpAddress,
10
+ _In_ DWORD Flags,
11
+ _In_ DHCP_OPTION_ID OptionId,
12
+ _In_opt_ LPWSTR ClassName,
13
+ _In_opt_ LPWSTR VendorName,
14
+ _In_ LPDHCP_OPTION OptionInfo
15
+ );
16
+ =end
17
+ attach_function :DhcpCreateOptionV5, [:pointer, :uint32, :uint32, :pointer, :pointer, :pointer], :uint32
18
+
19
+ =begin
20
+ DWORD DhcpGetOptionInfoV5(
21
+ _In_ LPWSTR ServerIpAddress,
22
+ _In_ DWORD Flags,
23
+ _In_ DHCP_OPTION_ID OptionID,
24
+ _In_ LPWSTR ClassName,
25
+ _In_ LPWSTR VendorName,
26
+ _Out_ LPDHCP_OPTION *OptionInfo
27
+ );
28
+ =end
29
+ attach_function :DhcpGetOptionInfoV5, [:pointer, :uint32, :uint32, :pointer, :pointer, :pointer], :uint32
30
+
31
+ =begin
32
+ DWORD DhcpRemoveOptionV5(
33
+ _In_ LPWSTR ServerIpAddress,
34
+ _In_ DWORD Flags,
35
+ _In_ DHCP_OPTION_ID OptionID,
36
+ _In_ LPWSTR ClassName,
37
+ _In_ LPWSTR VendorName
38
+ );
39
+ =end
40
+ attach_function :DhcpRemoveOptionV5, [:pointer, :uint32, :uint32, :pointer, :pointer], :uint32
41
+
42
+ =begin
43
+ DWORD DhcpEnumOptionsV5(
44
+ _In_ LPWSTR ServerIpAddress,
45
+ _In_ DWORD Flags,
46
+ _In_ LPWSTR ClassName,
47
+ _In_ LPWSTR VendorName,
48
+ _Inout_ DHCP_RESUME_HANDLE *ResumeHandle,
49
+ _In_ DWORD PreferredMaximum,
50
+ _Out_ LPDHCP_OPTION_ARRAY *Options,
51
+ _Out_ DWORD *OptionsRead,
52
+ _Out_ DWORD *OptionsTotal
53
+ );
54
+ =end
55
+ attach_function :DhcpEnumOptionsV5, [:pointer, :uint32, :pointer, :pointer, :pointer, :uint32, :pointer, :pointer, :pointer], :uint32
56
+ end
57
+ end
@@ -0,0 +1,61 @@
1
+ module DhcpsApi::Win2008
2
+ module OptionValue
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DhcpEnumOptionValuesV5(
9
+ _In_ LPWSTR ServerIpAddress,
10
+ _In_ DWORD Flags,
11
+ _In_ LPWSTR ClassName,
12
+ _In_ LPWSTR VendorName,
13
+ _In_ LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
14
+ _Inout_ DHCP_RESUME_HANDLE *ResumeHandle,
15
+ _In_ DWORD PreferredMaximum,
16
+ _Out_ LPDHCP_OPTION_VALUE_ARRAY *OptionValues,
17
+ _Out_ DWORD *OptionsRead,
18
+ _Out_ DWORD *OptionsTotal
19
+ );
20
+ =end
21
+ attach_function :DhcpEnumOptionValuesV5, [:pointer, :uint32, :pointer, :pointer, :pointer, :pointer, :uint32, :pointer, :pointer, :pointer], :uint32
22
+
23
+ =begin
24
+ DWORD DhcpGetOptionValueV5(
25
+ _In_ LPWSTR ServerIpAddress,
26
+ _In_ DWORD Flags,
27
+ _In_ DHCP_OPTION_ID OptionID,
28
+ _In_ LPWSTR ClassName,
29
+ _In_ LPWSTR VendorName,
30
+ _In_ DHCP_CONST DHCP_OPTION_SCOPE_INFO ScopeInfo,
31
+ _Out_ LPDHCP_OPTION_VALUE *OptionValue
32
+ );
33
+ =end
34
+ attach_function :DhcpGetOptionValueV5, [:pointer, :uint32, :uint32, :pointer, :pointer, DhcpsApi::DHCP_OPTION_SCOPE_INFO.by_value, :pointer], :uint32
35
+
36
+ =begin
37
+ DWORD DhcpRemoveOptionValueV5(
38
+ _In_ LPWSTR ServerIpAddress,
39
+ _In_ DWORD Flags,
40
+ _In_ DHCP_OPTION_ID OptionID,
41
+ _In_ LPWSTR ClassName,
42
+ _In_ LPWSTR VendorName,
43
+ _In_ DHCP_CONST DHCP_OPTION_SCOPE_INFO ScopeInfo
44
+ );
45
+ =end
46
+ attach_function :DhcpRemoveOptionValueV5, [:pointer, :uint32, :uint32, :pointer, :pointer, DhcpsApi::DHCP_OPTION_SCOPE_INFO.by_value], :uint32
47
+
48
+ =begin
49
+ DWORD DhcpSetOptionValueV5(
50
+ _In_ LPWSTR ServerIpAddress,
51
+ _In_ DWORD Flags,
52
+ _In_ DHCP_OPTION_ID OptionId,
53
+ _In_opt_ LPWSTR ClassName,
54
+ _In_opt_ LPWSTR VendorName,
55
+ _In_ LDHCP_CONST DHCP_OPTION_SCOPE_INFO ScopeInfo,
56
+ _In_ LDHCP_CONST DHCP_OPTION_DATA OptionValue
57
+ );
58
+ =end
59
+ attach_function :DhcpSetOptionValueV5, [:pointer, :uint32, :uint32, :pointer, :pointer, :pointer, :pointer], :uint32
60
+ end
61
+ end
@@ -0,0 +1,46 @@
1
+ module DhcpsApi::Win2008
2
+ module Subnet
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DHCP_API_FUNCTION DhcpEnumSubnets(
9
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
10
+ _Inout_ DHCP_RESUME_HANDLE *ResumeHandle,
11
+ _In_ DWORD PreferredMaximum,
12
+ _Out_ LPDHCP_IP_ARRAY *EnumInfo,
13
+ _Out_ DWORD *ElementsRead,
14
+ _Out_ DWORD *ElementsTotal
15
+ );
16
+ =end
17
+ attach_function :DhcpEnumSubnets, [:pointer, :pointer, :uint32, :pointer, :pointer, :pointer], :uint32
18
+
19
+ =begin
20
+ DWORD DHCP_API_FUNCTION DhcpCreateSubnet(
21
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
22
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
23
+ _In_ DHCP_CONST DHCP_SUBNET_INFO *SubnetInfo
24
+ );
25
+ =end
26
+ attach_function :DhcpCreateSubnet, [:pointer, :uint32, :pointer], :uint32
27
+
28
+ =begin
29
+ DWORD DHCP_API_FUNCTION DhcpDeleteSubnet(
30
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
31
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
32
+ _In_ DHCP_FORCE_FLAG ForceFlag
33
+ );
34
+ =end
35
+ attach_function :DhcpDeleteSubnet, [:pointer, :uint32, :uint32], :uint32
36
+
37
+ =begin
38
+ DWORD DHCP_API_FUNCTION DhcpGetSubnetInfo(
39
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
40
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
41
+ _Out_ LPDHCP_SUBNET_INFO *SubnetInfo
42
+ );
43
+ =end
44
+ attach_function :DhcpGetSubnetInfo, [:pointer, :uint32, :pointer], :uint32
45
+ end
46
+ end
@@ -0,0 +1,26 @@
1
+ module DhcpsApi::Win2008
2
+ module SubnetElement
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DhcpAddSubnetElementV4(
9
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
10
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
11
+ _In_ DHCP_CONST DHCP_SUBNET_ELEMENT_DATA_V4 *AddElementInfo
12
+ );
13
+ =end
14
+ attach_function :DhcpAddSubnetElementV4, [:pointer, :uint32, :pointer], :uint32
15
+
16
+ =begin
17
+ DWORD DHCP_API_FUNCTION DhcpRemoveSubnetElementV4(
18
+ _In_ DHCP_CONST WCHAR *ServerIpAddress,
19
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
20
+ _In_ DHCP_CONST DHCP_SUBNET_ELEMENT_DATA_V4 *RemoveElementInfo,
21
+ _In_ DHCP_FORCE_FLAG ForceFlag
22
+ );
23
+ =end
24
+ attach_function :DhcpRemoveSubnetElementV4, [:pointer, :uint32, :pointer, :uint32], :uint32
25
+ end
26
+ end
@@ -0,0 +1,21 @@
1
+ module DhcpsApi::Win2012
2
+ module Client
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DHCP_API_FUNCTION DhcpV4EnumSubnetClients(
9
+ _In_opt_ DHCP_CONST WCHAR *ServerIpAddress,
10
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
11
+ _Inout_ DHCP_RESUME_HANDLE *ResumeHandle,
12
+ _In_ DWORD PreferredMaximum,
13
+ _Out_ LPDHCP_CLIENT_INFO_PB_ARRAY *ClientInfo,
14
+ _Out_ DWORD *ClientsRead,
15
+ _Out_ DWORD *ClientsTotal
16
+ );
17
+ =end
18
+ attach_function :DhcpV4EnumSubnetClients, [:pointer, :uint32, :pointer, :uint32, :pointer, :pointer, :pointer], :uint32
19
+ end
20
+ end
21
+
@@ -0,0 +1,19 @@
1
+ module DhcpsApi::Win2012
2
+ module Misc
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DHCP_API_FUNCTION DhcpV4GetFreeIPAddress(
9
+ _In_opt_ LPWSTR ServerIpAddress,
10
+ _In_ DHCP_IP_ADDRESS ScopeId,
11
+ _In_ DHCP_IP_ADDRESS startIP,
12
+ _In_ DHCP_IP_ADDRESS endIP,
13
+ _In_ DWORD numFreeAddrReq,
14
+ _Out_ LPDHCP_IP_ARRAY *IPAddrList
15
+ );
16
+ =end
17
+ attach_function :DhcpV4GetFreeIPAddress, [:pointer, :uint32, :uint32, :uint32, :uint32, :pointer], :uint32
18
+ end
19
+ end
@@ -0,0 +1,20 @@
1
+ module DhcpsApi::Win2012
2
+ module Reservation
3
+ extend FFI::Library
4
+ ffi_lib 'dhcpsapi'
5
+ ffi_convention :stdcall
6
+
7
+ =begin
8
+ DWORD DHCP_API_FUNCTION DhcpV4EnumSubnetReservations(
9
+ _In_opt_ DHCP_CONST WCHAR *ServerIpAddress,
10
+ _In_ DHCP_IP_ADDRESS SubnetAddress,
11
+ _Inout_ DHCP_RESUME_HANDLE *ResumeHandle,
12
+ _In_ DWORD PreferredMaximum,
13
+ _Out_ LPDHCP_RESERVATION_INFO_ARRAY *EnumElementInfo,
14
+ _Out_ DWORD *ElementsRead,
15
+ _Out_ DWORD *ElementsTotal
16
+ );
17
+ =end
18
+ attach_function :DhcpV4EnumSubnetReservations, [:pointer, :uint32, :pointer, :uint32, :pointer, :pointer, :pointer], :uint32
19
+ end
20
+ end
data/lib/dhcpsapi.rb CHANGED
@@ -1,16 +1,14 @@
1
1
  require 'ffi'
2
- require 'dhcpsapi/ffi'
3
2
  require 'dhcpsapi/enums'
4
3
  require 'dhcpsapi/version'
5
4
  require 'dhcpsapi/common'
6
- require 'dhcpsapi/common_data_structs'
5
+ require 'dhcpsapi/data_structures'
7
6
  require 'dhcpsapi/error'
8
7
  require 'dhcpsapi/class'
8
+ require 'dhcpsapi/client'
9
+ require 'dhcpsapi/misc'
9
10
  require 'dhcpsapi/option'
10
11
  require 'dhcpsapi/option_value'
11
- require 'dhcpsapi/subnet'
12
- require 'dhcpsapi/subnet_element'
13
12
  require 'dhcpsapi/reservation'
14
- require 'dhcpsapi/client'
15
- require 'dhcpsapi/misc'
13
+ require 'dhcpsapi/subnet'
16
14
  require 'dhcpsapi/server'
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhcpsapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitri Dolguikh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '4.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '4.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Ruby wrappers for MS DHCP api
@@ -79,21 +79,27 @@ files:
79
79
  - lib/dhcpsapi/class.rb
80
80
  - lib/dhcpsapi/client.rb
81
81
  - lib/dhcpsapi/common.rb
82
- - lib/dhcpsapi/common_data_structs.rb
82
+ - lib/dhcpsapi/data_structures.rb
83
83
  - lib/dhcpsapi/enums.rb
84
84
  - lib/dhcpsapi/error.rb
85
- - lib/dhcpsapi/ffi.rb
86
85
  - lib/dhcpsapi/misc.rb
87
86
  - lib/dhcpsapi/option.rb
88
87
  - lib/dhcpsapi/option_value.rb
89
88
  - lib/dhcpsapi/reservation.rb
90
89
  - lib/dhcpsapi/server.rb
91
90
  - lib/dhcpsapi/subnet.rb
92
- - lib/dhcpsapi/subnet_element.rb
93
91
  - lib/dhcpsapi/version.rb
94
- - lib/dhcpsapi_for_testing.rb
95
- - lib/dhcpsapi_for_testing/server.rb
96
- homepage: https://github.com/witlessbird/ruby-dhcpsapi
92
+ - lib/dhcpsapi/win2008/class.rb
93
+ - lib/dhcpsapi/win2008/client.rb
94
+ - lib/dhcpsapi/win2008/free_memory.rb
95
+ - lib/dhcpsapi/win2008/option.rb
96
+ - lib/dhcpsapi/win2008/option_value.rb
97
+ - lib/dhcpsapi/win2008/subnet.rb
98
+ - lib/dhcpsapi/win2008/subnet_element.rb
99
+ - lib/dhcpsapi/win2012/client.rb
100
+ - lib/dhcpsapi/win2012/misc.rb
101
+ - lib/dhcpsapi/win2012/reservation.rb
102
+ homepage: https://github.com/witlessbird/ruby-dhcpsapi_win2008
97
103
  licenses:
98
104
  - Apache License, v2.0
99
105
  metadata: {}
@@ -103,17 +109,17 @@ require_paths:
103
109
  - lib
104
110
  required_ruby_version: !ruby/object:Gem::Requirement
105
111
  requirements:
106
- - - '>='
112
+ - - ">="
107
113
  - !ruby/object:Gem::Version
108
114
  version: '0'
109
115
  required_rubygems_version: !ruby/object:Gem::Requirement
110
116
  requirements:
111
- - - '>='
117
+ - - ">="
112
118
  - !ruby/object:Gem::Version
113
119
  version: '0'
114
120
  requirements: []
115
121
  rubyforge_project:
116
- rubygems_version: 2.4.8
122
+ rubygems_version: 2.5.1
117
123
  signing_key:
118
124
  specification_version: 4
119
125
  summary: Ruby wrappers for MS DHCP api