Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.3 KiB

  1. //================================================================================
  2. // Copyright (C) 1997 Microsoft Corporation
  3. // Author: RameshV
  4. // Description: Download and Upload related code.
  5. //================================================================================
  6. //================================================================================
  7. // includes
  8. //================================================================================
  9. #include <hdrmacro.h>
  10. #include <store.h>
  11. #include <dhcpmsg.h>
  12. #include <wchar.h>
  13. #include <dhcpbas.h>
  14. #include <mm\opt.h>
  15. #include <mm\optl.h>
  16. #include <mm\optdefl.h>
  17. #include <mm\optclass.h>
  18. #include <mm\classdefl.h>
  19. #include <mm\bitmask.h>
  20. #include <mm\reserve.h>
  21. #include <mm\range.h>
  22. #include <mm\subnet.h>
  23. #include <mm\sscope.h>
  24. #include <mm\oclassdl.h>
  25. #include <mm\server.h>
  26. #include <mm\address.h>
  27. #include <mm\server2.h>
  28. #include <mm\memfree.h>
  29. #include <mmreg\regutil.h>
  30. #include <mmreg\regread.h>
  31. #include <mmreg\regsave.h>
  32. #include <dhcpapi.h>
  33. #include <delete.h>
  34. #include <st_srvr.h>
  35. #include <rpcapi2.h>
  36. #include <rpcstubs.h>
  37. //================================================================================
  38. // utilities
  39. //================================================================================
  40. BOOL _inline
  41. AddressFoundInHostent(
  42. IN DHCP_IP_ADDRESS AddrToSearch, // Host-Order addr
  43. IN HOSTENT *ServerEntry // entry to search for..
  44. )
  45. {
  46. ULONG nAddresses, ThisAddress;
  47. if( NULL == ServerEntry ) return FALSE; // no address to search in
  48. nAddresses = 0; // have a host entry to compare for addresses
  49. while( ServerEntry->h_addr_list[nAddresses] ) {
  50. ThisAddress = ntohl(*(DHCP_IP_ADDRESS*)ServerEntry->h_addr_list[nAddresses++] );
  51. if( ThisAddress == AddrToSearch ) {
  52. return TRUE; // yeah address matched.
  53. }
  54. }
  55. return FALSE;
  56. }
  57. //================================================================================
  58. // end of file
  59. //================================================================================