|
|
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
Доброго времени суток! Как прочитать из DHCP-сервера адреса и соответствующие имена компов ? Если есть исходник или готовый пример, кто-нибудь дайте пожалуйста... Заранее спасибо! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2007, 16:46 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
Посмотреть протокол DHCP RFC 1541 ________________________________________________________ Глюк - это высокоорганизованная система не поддающихся определению частиц ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2007, 20:49 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
В Platform SDK for Windows есть примеры: Platform SDK for Windows XP SP2 Platform SDK: Dynamic Host Configuration Protocol (DHCP) DhcpEnumSubnetClients The DhcpEnumSubnetClients function returns an enumerated list of clients with served IP addresses in the specified subnet. DWORD DHCP_API_FUNCTION DhcpEnumSubnetClients( DHCP_CONST WCHAR* ServerIpAddress, DHCP_IP_ADDRESS SubnetAddress, DHCP_RESUME_HANDLE* ResumeHandle, DWORD PreferredMaximum, LPDHCP_CLIENT_INFO_ARRAY* ClientInfo, DWORD* ClientsRead, DWORD* ClientsTotal ); Parameters ServerIpAddress [in] Unicode string that specifies the IP address of the DHCP server. SubnetAddress [in] DHCP_IP_ADDRESS value that contains the subnet ID. ResumeHandle [in, out] Pointer to a DHCP_RESUME_HANDLE value that identifies the enumeration operation. Initially, this value should be zero, with a successful call returning the handle value used for subsequent enumeration requests. For example, if PreferredMaximum is set to 1000 bytes, and 2000 bytes worth of subnet client information structures are stored on the server, the resume handle can be used after the first 1000 bytes are retrieved to obtain the next 1000 on a subsequent call, and so forth. PreferredMaximum [in] Specifies the preferred maximum number of bytes of subnet client information structures to return. If the number of remaining unenumerated options (in bytes) is less than this value, then that amount will be returned. The minimum value is 1024 bytes (1KB), and the maximum value is 65536 bytes (64KB); if the input value is greater or less than this range, it will be set to the maximum or minimum value, respectively. ClientInfo [out] Pointer to a DHCP_CLIENT_INFO_ARRAY structure that contains information on the clients served under this specific subnet. If no clients are available, this field will be null. ClientsRead [out] Pointer to a DWORD value that specifies the number of clients returned in ClientInfo. ClientsTotal [out] Pointer to a DWORD value that specifies the number of clients for the specified subnet that have not yet been enumerated. Note This value is set to the correct value during the final enumeration call; however, prior calls to this function set the value as 0x7FFFFFFF. Return Values This function returns ERROR_MORE_DATA upon a successful call. The final call to this method with the last set of subnet clients returns ERROR_SUCCESS. Otherwise, it returns one of the DHCP Server Management API Error Codes. Remarks This function requires host byte ordering for all DHCP_IP_ADDRESS values in parameter structures. Requirements Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0. Header: Declared in Dhcpsapi.h. Library: Use Dhcpsapi.lib. See Also DHCP_CLIENT_INFO_ARRAY -------------------------------------------------------------------------------- Last updated: April 2004 | What did you think of this topic? | Order a Platform SDK CD © 2004 Microsoft Corporation. All rights reserved. Terms of use. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2007, 21:29 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
Дело в том, что я не особо силен. Че-то я не могу сообразить как написать процедуру. Где можно найти конкретный работающий пример на VC++6.0 ? Если можете - приведите прямо здесь, в форуме. Дайте пожалуйста... Спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2007, 18:28 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
А эта ссылка поможет? http://borland.xportal.ru/forum/viewtopic.php?t=1826&highlight=bool+getip ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.06.2007, 19:33 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
Alex_TomsА эта ссылка поможет? http://borland.xportal.ru/forum/viewtopic.php?t=1826&highlight=bool+getip Нет не то. Мне нужен пример на VC++ ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.06.2007, 12:19 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
_Ildar_ Alex_TomsА эта ссылка поможет? http://borland.xportal.ru/forum/viewtopic.php?t=1826&highlight=bool+getip Нет не то. Мне нужен пример на VC++ А вы и ЕСТЬ за меня будете ??? (с) Вовка в тридевятом царстве ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.06.2007, 13:03 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
Gluk (Kazan) _Ildar_ Alex_TomsА эта ссылка поможет? http://borland.xportal.ru/forum/viewtopic.php?t=1826&highlight=bool+getip Нет не то. Мне нужен пример на VC++ А вы и ЕСТЬ за меня будете ??? (с) Вовка в тридевятом царстве Огромное спасибо за ответ, но я не нашел в SDK и MSDN конкретных примеров использования. Только чисто описалово функции. Может быть надо использовать при определенных условиях. А при каких ? Может быть предварительно требуется какая-то инициализация? Какую функцию использовать? А после? Может быть есть процедуры деинициализации интерфейса? Какие? Скачал со страницы Windows® Server 2003 R2 Platform SDK Full Download Установил. Нашел файл dhcpsapi.h. В нем описаны следующие функции: DhcpGetVersion( LPWSTR ServerIpAddress, LPDWORD MajorVersion, LPDWORD MinorVersion ); DWORD DHCP_API_FUNCTION DhcpSetServerBindingInfo( DHCP_CONST WCHAR *ServerIpAddress, ULONG Flags, LPDHCP_BIND_ELEMENT_ARRAY BindElementInfo ); DWORD DHCP_API_FUNCTION DhcpGetServerBindingInfo( DHCP_CONST WCHAR *ServerIpAddress, ULONG Flags, LPDHCP_BIND_ELEMENT_ARRAY *BindElementsInfo ); DWORD DHCP_API_FUNCTION DhcpCreateClientInfo( DHCP_CONST WCHAR *ServerIpAddress, DHCP_CONST DHCP_CLIENT_INFO *ClientInfo ); DWORD DHCP_API_FUNCTION DhcpSetClientInfo( DHCP_CONST WCHAR *ServerIpAddress, DHCP_CONST DHCP_CLIENT_INFO *ClientInfo ); DWORD DHCP_API_FUNCTION DhcpGetClientInfo( DHCP_CONST WCHAR *ServerIpAddress, DHCP_CONST DHCP_SEARCH_INFO *SearchInfo, LPDHCP_CLIENT_INFO *ClientInfo ); DWORD DHCP_API_FUNCTION DhcpDeleteClientInfo( DHCP_CONST WCHAR *ServerIpAddress, DHCP_CONST DHCP_SEARCH_INFO *ClientInfo ); DWORD DHCP_API_FUNCTION DhcpEnumSubnetClients( DHCP_CONST WCHAR *ServerIpAddress, DHCP_IP_ADDRESS SubnetAddress, DHCP_RESUME_HANDLE *ResumeHandle, DWORD PreferredMaximum, LPDHCP_CLIENT_INFO_ARRAY *ClientInfo, DWORD *ClientsRead, DWORD *ClientsTotal ); DWORD DHCP_API_FUNCTION DhcpEnumSubnets( DHCP_CONST WCHAR *ServerIpAddress, DHCP_RESUME_HANDLE *ResumeHandle, DWORD PreferredMaximum, LPDHCP_IP_ARRAY *EnumInfo, DWORD *ElementsRead, DWORD *ElementsTotal ); DWORD DHCP_API_FUNCTION DhcpGetSubnetInfo( DHCP_CONST WCHAR *ServerIpAddress, DHCP_IP_ADDRESS SubnetAddress, LPDHCP_SUBNET_INFO * SubnetInfo ); DWORD DHCP_API_FUNCTION DhcpGetOptionValue( DHCP_CONST WCHAR *ServerIpAddress, DHCP_OPTION_ID OptionID, DHCP_CONST DHCP_OPTION_SCOPE_INFO *ScopeInfo, LPDHCP_OPTION_VALUE *OptionValue ); VOID DHCP_API_FUNCTION DhcpRpcFreeMemory( PVOID BufferPointer ); И какую функцию и в каком случае мне использовать? А? Кто нибудь знает? Ответьте пожалуйста. Спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.06.2007, 13:40 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
Дык номер RFC в треде прозвучал, сцылки на примеры коды приводили. Не понравился язык ? Скажи спасибо что не LISP ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.06.2007, 13:50 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
На тебе еще сцылок вполне достойно тож ничо статейка RFC 2131 за тебя твою работу никто не сделает, разбирайся ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.06.2007, 13:54 |
|
||
|
Как прочитать из DHCP-сервера адреса и соответствующие имена компов ?
|
|||
|---|---|---|---|
|
#18+
RFC 2132 тоже стоит почитать ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.06.2007, 13:56 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=34608464&tid=2028624]: |
0ms |
get settings: |
7ms |
get forum list: |
17ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
166ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
53ms |
get tp. blocked users: |
1ms |
| others: | 201ms |
| total: | 465ms |

| 0 / 0 |
