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.

380 lines
7.9 KiB

  1. /*++
  2. Copyright (c) 1999, Microsoft Corporation
  3. Module Name:
  4. sample\README
  5. Abstract:
  6. This file contains a brief description of the sources needed for the
  7. netsh extension to the sample ip routing protocol.
  8. --*/
  9. Netsh Commands Supported by this Helper...
  10. netsh>routing ip sample
  11. TOP LEVEL COMMANDS
  12. --------------------
  13. routing ip sample>install /?
  14. Usage: install
  15. Parameters:
  16. None.
  17. Remarks: Installs this routing protocol under IP.
  18. routing ip sample>uninstall /?
  19. Usage: uninstall
  20. Parameters:
  21. None.
  22. Remarks: Removes this IP routing protocol.
  23. routing ip sample>install /?
  24. Usage: install
  25. Installs this routing protocol under IP.
  26. routing ip sample>uninstall /?
  27. Usage: uninstall
  28. Removes this IP routing protocol.
  29. routing ip sample>dump /?
  30. Usage: dump
  31. Parameters:
  32. None
  33. Remarks: Dumps the configuration for the current context and subcontexts.
  34. To save the dumped configuration redirect the output to a file.
  35. routing ip sample>help /?
  36. Usage: help
  37. Parameters:
  38. None
  39. Remarks: Displays help.
  40. ADD COMMANDS
  41. --------------------
  42. routing ip sample>add interface /?
  43. Usage: add interface [name =]<string> [[metric=]<ulong>]
  44. Parameters:
  45. Tag Value
  46. name - Name of the interface.
  47. metric - Metric associated with the interface. (default: 0)
  48. Remarks: Configures SAMPLE on the specified interface.
  49. Examples:
  50. add interface name="Local Area Connection" metric=10
  51. DELETE COMMANDS
  52. --------------------
  53. routing ip sample>delete interface /?
  54. Usage: delete interface [name =]<string>
  55. Parameters:
  56. Tag Value
  57. name - Name of the interface.
  58. Remarks: Removes SAMPLE from the specified interface.
  59. Examples:
  60. delete interface name="Local Area Connection"
  61. SET COMMANDS
  62. --------------------
  63. routing ip sample>set global /?
  64. Usage: set global [[loglevel=]none|error|warn|info]
  65. Parameters:
  66. Tag Value
  67. loglevel - Level at which messages are logged. (default: info)
  68. Remarks: Sets SAMPLE global configuration parameters.
  69. Examples:
  70. set global loglevel=none
  71. routing ip sample>set interface /?
  72. Usage: set interface [name =]<string> [[metric=]<ulong>]
  73. Parameters:
  74. Tag Value
  75. name - Name of the interface.
  76. metric - Metric associated with the interface. (default: 0)
  77. Remarks: Sets SAMPLE configuration parameters for the interface.
  78. Examples:
  79. set interface name="Local Area Connection" metric=10
  80. SHOW COMMANDS
  81. --------------------
  82. routing ip sample>show global /?
  83. Usage: show global
  84. Parameters:
  85. None.
  86. Remarks: Shows SAMPLE global configuration parameters.
  87. Examples:
  88. show global
  89. routing ip sample>show interface /?
  90. Usage: show interface [[name =]<string>]
  91. Parameters:
  92. Tag Value
  93. name - Name of the interface. (default: all interfaces)
  94. Remarks: Shows SAMPLE configuration parameters for the interface.
  95. Examples:
  96. show interface name="Local Area Connection"
  97. routing ip sample>show globalstats /?
  98. Usage: show globalstats [[rr=]<seconds>]
  99. Parameters:
  100. Tag Value
  101. rr Display refresh rate. (default: no refresh)
  102. Remarks: Shows SAMPLE global statistics.
  103. Examples:
  104. show globalstats rr=5
  105. routing ip sample>show ifstats /?
  106. Usage: show ifstats [[index=]<ulong>] [[rr=]<seconds>]
  107. Parameters:
  108. Tag Value
  109. index - Index/Name of the interface. (default: all interfaces)
  110. rr - Display refresh rate. (default: no refresh)
  111. Remarks: Shows SAMPLE statistics for the interface.
  112. Examples:
  113. show ifstats index=1 rr=5
  114. // given that the information presented by this command is available in some
  115. // form in the "netsh interface ip" subcontext; this command may be considered
  116. // redundant. it was left there since it does little harm... but u be the
  117. // judge of that. i'll stop now :)
  118. routing ip sample>show ifbinding /?
  119. Usage: show ifbinding [[index=]<ulong>] [[rr=]<seconds>]
  120. Parameters:
  121. Tag Value
  122. index - Index/Name of the interface. (default: all interfaces)
  123. rr - Display refresh rate. (default: no refresh)
  124. Remarks: Show SAMPLE address bindings for the interface.
  125. Examples:
  126. show ifbinding index="Local Area Connection" rr=5
  127. ---------------------------------------------------------------------------
  128. Source Structure...
  129. common.[hc]
  130. variables and functions common to all contexts...
  131. - DllMain:
  132. DLL Entry Point
  133. - InitHelperDll:
  134. Registers helper (loading helper)
  135. - IpsamplemonStartHelper:
  136. Registers contexts (starting helper)
  137. - {netsh functions}
  138. Pointers initialized within InitHelperDll
  139. utils.[ch]
  140. data associated with a MIB object...
  141. typedef struct _MAGIC_ENTRY
  142. {
  143. PWCHAR pwszObjectName;
  144. DWORD dwObjectId;
  145. PGET_INDEX_FUNCTION pfnGetIndex;
  146. DWORD dwHeaderMessageId;
  147. PPRINT_FUNCTION pfnPrint;
  148. } MAGIC_ENTRY, *PMAGIC_ENTRY;
  149. utilities used by different contexts...
  150. - IsInterfaceInstalled:
  151. Whether the interface has been added to the protocol
  152. - VerifyInstalled
  153. Whether protocol has been installed
  154. - GetIfIndex
  155. Get interface index from mib interface argument (name or index)
  156. - MibGet
  157. Get MIB object specified by input key and mode (exact, first, next)
  158. - GetString
  159. Get 'dump' or 'show' string for the given value.
  160. sample.[ch]
  161. global information for a context...
  162. typedef struct _CONTEXT_ENTRY
  163. {
  164. // context' identifying string
  165. PWSTR pwszName;
  166. // top level (non group) commands
  167. ULONG ulNumTopCmds;
  168. CMD_ENTRY *pTopCmds;
  169. // group commands
  170. ULONG ulNumGroupCmds;
  171. CMD_GROUP_ENTRY *pGroupCmds;
  172. // default configuration
  173. PBYTE pDefaultGlobal;
  174. PBYTE pDefaultInterface;
  175. // dump function
  176. PNS_CONTEXT_DUMP_FN pfnDump;
  177. } CONTEXT_ENTRY, *PCONTEXT_ENTRY;
  178. variables and functions specific to the sample context
  179. - g_ceSample:
  180. sample context entry
  181. - SampleInitialize:
  182. sample context entry initialization function
  183. samplecfg.[ch]
  184. functions related to sample global and sample interface configuration
  185. - SGC_Make:
  186. Create the default sample global configuration blob
  187. - SGC_Show:
  188. Display sample global configuration
  189. Used for dump as well as show commands
  190. - SGC_Update:
  191. Updates sample global configuration
  192. - SIC_Make:
  193. Create the default sample interface configuration blob
  194. - SIC_ShowAll
  195. Displays sample configuration for all interfaces
  196. Used for dump as well as show commands
  197. - SIC_Show
  198. Displays sample configuration for an interface
  199. Used for dump as well as show commands
  200. - SIC_Update
  201. Updates sample interface configuration
  202. samplegetopt.[ch]
  203. command handlers
  204. {
  205. VerifyInstalled
  206. PreprocessCommand
  207. ProcessArguments
  208. ProcessError
  209. PerformFunction
  210. }
  211. samplemib.[ch]
  212. command handlers for displaying mib objects {globalstats|ifstats|ifbinding}
  213. {
  214. VerifyInstalled
  215. FigureMibObject
  216. PreprocessCommand
  217. ProcessArguments
  218. ProcessError
  219. for(ever) // refresh loop
  220. {
  221. for(ever) // display table loop
  222. {
  223. MibGet
  224. MibDisplay
  225. }
  226. }
  227. }
  228. README This file.
  229. makefile Used unchanged
  230. makefile.sdk SDK makefile
  231. sources Build instructions.
  232. ipsamplemn.def Exported function (InitHelperDll).
  233. ipsamplemn.rc Resource file.