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.

147 lines
7.6 KiB

  1. //--------------------------------------------------------------------------------
  2. // Copyright (C) Micorosoft Confidential 1997
  3. // Author: RameshV
  4. // Description: Option related registry handling -- common between NT and VxD
  5. //--------------------------------------------------------------------------------
  6. #ifndef OPTREG_H
  7. #define OPTREG_H
  8. //--------------------------------------------------------------------------------
  9. // Exported functions: Caller must take locks and any lists accessed
  10. //--------------------------------------------------------------------------------
  11. DWORD // status
  12. DhcpRegReadOptionDefList( // fill DhcpGlobalOptionDefList
  13. VOID
  14. );
  15. DWORD // status
  16. DhcpRegFillSendOptions( // fill in the list of options for SENDING
  17. IN OUT PLIST_ENTRY SendOptList, // list to add too
  18. IN LPWSTR AdapterName, // adapter name to fill for
  19. IN LPBYTE ClassId, // class id to assume for filling
  20. IN DWORD ClassIdLen // the length of the classId in bytes
  21. );
  22. DWORD // status
  23. DhcpRegSaveOptions( // save these options onto the registry
  24. IN PLIST_ENTRY SaveOptList, // list of options to save
  25. IN LPWSTR AdapterName, // adapter name
  26. IN LPBYTE ClassName, // the current class
  27. IN DWORD ClassLen // length of the above in bytes
  28. );
  29. BOOLEAN // status
  30. DhcpRegIsOptionChanged(
  31. IN PLIST_ENTRY SaveOptList, // list of options to save
  32. IN LPWSTR AdapterName, // adapter name
  33. IN LPBYTE ClassName, // the current class
  34. IN DWORD ClassLen // length of the above in bytes
  35. );
  36. DWORD // status
  37. DhcpRegReadOptionCache( // read the list of options from cache
  38. IN OUT PLIST_ENTRY OptionsList, // add the options to this list
  39. IN HKEY KeyHandle, // registry key where options are stored
  40. IN LPWSTR ValueName, // name of the value holding the options blob
  41. IN BOOLEAN fAddClassList
  42. );
  43. POPTION // option from which more appends can occur
  44. DhcpAppendSendOptions( // append all configured options
  45. IN OUT PDHCP_CONTEXT DhcpContext, // this is the context to append for
  46. IN PLIST_ENTRY SendOptionsList,
  47. IN LPBYTE ClassName, // current class
  48. IN DWORD ClassLen, // len of above in bytes
  49. IN LPBYTE BufStart, // start of buffer
  50. IN LPBYTE BufEnd, // how far can we go in this buffer
  51. IN OUT LPBYTE SentOptions, // BoolArray[OPTION_END+1] to avoid repeating options
  52. IN OUT LPBYTE VSentOptions, // to avoid repeating vendor specific options
  53. IN OUT LPBYTE VendorOpt, // Buffer[OPTION_END+1] Holding Vendor specific options
  54. OUT LPDWORD VendorOptLen // the # of bytes filled into that
  55. );
  56. DWORD // status
  57. DhcpAddIncomingOption( // this option just arrived, add it to list
  58. IN LPWSTR AdapterName,
  59. IN OUT PLIST_ENTRY RecdOptionsList,
  60. IN DWORD OptionId, // option id of the option
  61. IN BOOL IsVendor, // is it vendor specific?
  62. IN LPBYTE ClassName, // what is the class name?
  63. IN DWORD ClassLen, // what is the class name's lenght in bytes?
  64. IN DWORD ServerId, // server ip from which this option came
  65. IN LPBYTE Data, // this is the real data value coming in
  66. IN DWORD DataLen, // the length of above in # of bytes
  67. IN time_t ExpiryTime, // when does this option expire?
  68. IN BOOL IsApiCall // is this coming from an API call?
  69. );
  70. DWORD // status
  71. DhcpCopyFallbackOptions( // copies the Fallback options list to RecdOptionsList
  72. IN OUT PDHCP_CONTEXT DhcpContext, // NIC context
  73. OUT LPDHCP_IP_ADDRESS Address, // Fallback address as taken from option 50
  74. OUT LPDHCP_IP_ADDRESS SubnetMask // SubnetMask as taken from option 1
  75. );
  76. DWORD // status
  77. MadcapAddIncomingOption( // this option just arrived, add it to list
  78. IN OUT PLIST_ENTRY RecdOptionsList,
  79. IN DWORD OptionId, // option id of the option
  80. IN DWORD ServerId, // server ip from which this option came
  81. IN LPBYTE Data, // this is the real data value coming in
  82. IN DWORD DataLen, // the length of above in # of bytes
  83. IN DWORD ExpiryTime // when does this option expire?
  84. );
  85. DWORD // status
  86. DhcpDestroyOptionsList( // destroy a list of options, freeing up memory
  87. IN OUT PLIST_ENTRY OptionsList, // this is the list of options to destroy
  88. IN PLIST_ENTRY ClassesList // this is where to remove classes off
  89. );
  90. DWORD // win32 status
  91. DhcpClearAllOptions( // remove all turds from off registry
  92. IN OUT PDHCP_CONTEXT DhcpContext // the context to clear for
  93. );
  94. DWORD // status
  95. DhcpRegSaveOptionAtLocation( // save this option at this particular location
  96. IN PDHCP_OPTION OptionInfo, // optin to save
  97. IN LPWSTR RegLocation, // location to save at
  98. IN DWORD RegValueType, // type of the value to save at
  99. IN BOOL SpecialCase // dirty downward compatabiltiy?
  100. );
  101. DWORD // status
  102. DhcpRegSaveOptionAtLocationEx( // save the option in the required place in registry
  103. IN PDHCP_OPTION OptionInfo, // save THIS option
  104. IN LPWSTR AdapterName, // for this adpater,
  105. IN LPWSTR RegLocMZ, // multiple locations in the registry
  106. IN DWORD SaveValueType // What is the type of the value?
  107. );
  108. DWORD
  109. DhcpRegDeleteIpAddressAndOtherValues( // delete IPAddress, SubnetMask values from off key
  110. IN HKEY Key // handle to adapter regkey..
  111. );
  112. DWORD // status
  113. DhcpRegClearOptDefs( // clear all standard options
  114. IN LPWSTR AdapterName // clear for this adapter
  115. );
  116. DWORD
  117. DhcpDeleteRegistryOption(
  118. LPWSTR pwstrAdapterName,
  119. DWORD dwOption,
  120. BOOL bIsVendor
  121. );
  122. VOID
  123. DhcpCleanupOptionDefList(
  124. IN PLIST_ENTRY OptionDefList
  125. );
  126. #endif OPTREG_H