swreg.inc.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?php
  2. //# DO NOT MODIFY
  3. define('PROVISION_UNKNOWN', -2);
  4. define('PROVISION_IN_PROGRESS', -1);
  5. define('PROVISION_FAIL', 0);
  6. define('PROVISION_SUCCESS', 1);
  7. define('REACHABILITY_NEVER_REACHABLE', 0);
  8. define('REACHABILITY_NOW_UNREACHABLE', 1);
  9. define('REACHABILITY_REACHABLE', 2);
  10. //# END DO NOT MODIFY
  11. // Globals
  12. define('LOGFILE', '/var/log/swreg.log');
  13. define('LOG_LEVEL', 7);
  14. define('TFTPBOOT', '/tftpboot');
  15. define('PORT_TMPL_DIR', TFTPBOOT . '/port-templates');
  16. define('VLAN_TMPL_DIR', TFTPBOOT . '/vlan-templates');
  17. define('DEVICE_TMPL_DIR', TFTPBOOT . '/device-templates');
  18. define('DEVICE_CONFIG_DIR', TFTPBOOT . '/device-configs');
  19. define('DEVICE_TMP_DIR', TFTPBOOT . '/device-tmp');
  20. define('PORT_PROFILE_DIR', TFTPBOOT . '/port-profiles');
  21. define('EEM_TMPL_DIR', TFTPBOOT . '/eem-templates');
  22. define('FPING_PROGRAM', '/usr/local/sbin/fping');
  23. define('USE_PNP', true);
  24. define('EXPORT_PRIME', true);
  25. define('EXPORT_DEADMAN', true);
  26. define('TOOL_NAME', 'CiscoLive Switch Registration Tool');
  27. define('PRIME_CRED_PROFILE', 'CLUS-creds');
  28. define('PRIME_URL', 'https://63.231.220.90');
  29. define('APIC_HOST', 'apic-em.marcuscom.com');
  30. define('DNS_SERVER', '216.206.190.98');
  31. define('DNS_ZONE', 'noc.ciscolive.com');
  32. define('REST_RETRY_INTERVAL', 3);
  33. define('REST_RETRIES', 1);
  34. define('REST_TIMEOUT', 300);
  35. define('DEBUG', 0);
  36. // Addressing scheme
  37. // Choose one of IDF, NEXT_FREE, or NONE
  38. // IDF : The IDF switch is assumed to be .1 and each switch associated with
  39. // it will match on the first three octets.
  40. // NEXT_FREE : Pick the next free address for a given MDF
  41. // DNS : Do a DNS lookup on the given name and use that IP
  42. // NONE : IP address assignment will be done manually
  43. define('ADDRESS_SCHEME', 'IDF');
  44. // Regexps for Plug'n'Play (PnP) support
  45. // They only matter if the global, USE_PNP
  46. // is set to TRUE.
  47. // OPTIONAL
  48. $PNP_PATTERNS = array(
  49. '15\.2.+E' => true,
  50. );
  51. // The MDFs are L3 domains.
  52. // MANDATORY!
  53. $MDFS = array(
  54. 'HILTON',
  55. 'HYATT',
  56. 'NODE',
  57. 'SDCC',
  58. );
  59. // List all PIDs or PID patterns here.
  60. // MANDATORY!
  61. $ZTP_PIDS = array(
  62. 'WS-C3560CG-8PC-S',
  63. 'WS-C3750X',
  64. );
  65. // Fill in each of these arrays based on the ZTP PIDs listed above.
  66. // MANDATORY!
  67. $IMG_VERS = array(
  68. 'WS-C3560CG-8PC-S' => '15.0(2)SE7',
  69. 'WS-C3750X' => '15.0(2)SE7',
  70. );
  71. $IMG_FILES = array(
  72. 'WS-C3560CG-8PC-S' => 'c3560c405ex-universalk9-mz.150-2.SE7.bin',
  73. 'WS-C3750X' => 'c3750e-universalk9-mz.150-2.SE7.bin',
  74. );
  75. $START_PORTS = array(
  76. 'WS-C3560CG-8PC-S' => '0/1',
  77. 'WS-C3750X' => '1/0/1',
  78. );
  79. $PORT_TYPES = array(
  80. 'WS-C3560CG-8PC-S' => 'GigabitEthernet',
  81. 'WS-C3750X' => 'GigabitEthernet',
  82. );
  83. // End PID arrays
  84. // Fill out PIDs mapping to number of ports.
  85. // MANDATORY!
  86. $PID_PORTS = array(
  87. 'WS-C3560CG-8PC-S' => '8',
  88. 'WS-C3750X-24' => '24',
  89. 'WS-C3750X-48' => '48',
  90. );
  91. // Port patterns
  92. // The patterns that start a port name
  93. // MANDATORY!
  94. $PORT_PATTERNS = array(
  95. 'WS-C3560CG-8PC-S' => '0/',
  96. 'WS-C3750X-24' => '1/0/',
  97. 'WS-C3750X-48' => '1/0/',
  98. );
  99. // Map the PID ports to a ZTP PID
  100. // This is only needed if you don't use fully-qualified
  101. // PIDs in the ZTP PIDs.
  102. // OPTIONAL OBSOLETE!!!
  103. /*$PID_MAP = array(
  104. 'WS-C3750X-24' => 'WS-C3750X',
  105. 'WS-C3750X-48' => 'WS-C3750X',
  106. );*/
  107. // List any aliases here.
  108. // This goes from what the device may report
  109. // to a fully-qualified PID.
  110. $PID_ALIASES = array(
  111. 'WS-C3850-24U' => 'WS-C3850-24U-L',
  112. );
  113. // List any SDM profile preference here.
  114. // The profile will be configured at ZTP time.
  115. // If the PID is not here, no profile will be set.
  116. $SDM_PROFILES = array(
  117. );
  118. // Fill in VLAN mappings
  119. // VLAN macro will be the name with spaces turned to '_' and
  120. // all letters uppercase followed by _VLAN.
  121. // E.g., for NOC Device Mgmt, the macro will be
  122. // %%NOC_DEVICE_MGMT_VLAN%%
  123. // MANDATORY!
  124. $VLANS = array(
  125. 'NOC Device Mgmt' => '100',
  126. 'NOC Wired' => '110',
  127. 'Wireless AP' => '210',
  128. 'Voice TP' => '300',
  129. 'Video Surveillance' => '310',
  130. 'Speaker' => '350',
  131. 'CiscoTV' => '360',
  132. 'CiscoTV DMP' => '370',
  133. 'Session Capture' => '380',
  134. 'Cisco Store' => '390',
  135. 'Registration' => '400',
  136. 'Session Signage' => '420',
  137. 'Labs CCIE' => '500',
  138. 'Labs Testing Center' => '510',
  139. 'Labs Session Labs' => '520',
  140. 'DevNet' => '600',
  141. 'NOC Public' => '751',
  142. 'Registration Public' => '752',
  143. 'SDCC Public' => '753',
  144. 'Labs Public' => '754',
  145. 'CiscoTV Public' => '755',
  146. 'Cisco Campus Public' => '761',
  147. 'Wired NAT' => '2000',
  148. 'NODE Public' => '757',
  149. 'WoS Booths' => '550',
  150. 'WISP Labs' => '530',
  151. 'HILTON Public' => '758',
  152. 'HYATT Public' => '759',
  153. );
  154. // VLAN Overrides
  155. // Fill in any per-MDF VLAN override
  156. // OPTIONAL
  157. /*
  158. $VLAN_OVERRIDES = array(
  159. 'SDCC' => array(
  160. 'CiscoTV Public' => '756',
  161. ),
  162. 'NODE' => array(
  163. 'CiscoTV Public' => '762',
  164. ),
  165. );
  166. */
  167. // Custom Macros
  168. // Put any general custom macros and
  169. // their replacements here. They will
  170. // be converted to %%MACRO_NAME%% and replaced
  171. // in your configs.
  172. // OPTIONAL
  173. $CUSTOM_MACROS = array(
  174. 'MAX_MACS' => '10',
  175. );
  176. // MDF Overrides
  177. // Put macros here that will be replaced
  178. // based on the MDF location
  179. // OPTIONAL
  180. $MDF_OVERRIDES = array(
  181. 'NODE' => array(
  182. 'MAX_MACS' => '100',
  183. ),
  184. );
  185. // Hooks
  186. // Define scripts to call for various events.
  187. // VERIFY (hooks called when a device is verified)
  188. // SUCCESS: Called when a device is successfully verified
  189. // ARGS: <HOOK_NAME> <REMOTE_IP> <CONFIG_FILE> <SERIAL_NO> <IMAGE_MD5> <IMAGE_NAME>
  190. // FAIL : Called when a device fails to verify
  191. // ARGS: <HOOK_NAME> config|image <REMOTE_IP> <CONFIG_FILE> <SERIAL_NO> <IMAGE_MD5> <GOOD_MD5> <IMAGE_NAME>
  192. // REQUEST (hooks called when a device boostrap request is made)
  193. // NEW : Called when a new device request is received
  194. // ARGS: <HOOK_NAME> <REMOTE_IP> <HOSTNAME> <SERIAL_NO> <PID> <VERSION> <NUM_PORTS> <IMAGE_NAME>
  195. // UNKNOWN: Called when a request from an unmapped device is seen
  196. // ARGS: <HOOK_NAME> <REMOTE_IP> <SERIAL_NO> <PID>
  197. // ERROR: Called when a new request cannot be serviced due to an error
  198. // ARGS: <HOOK_NAME> <REMOTE_IP> <SERIAL_NO> <PID> <MSG>
  199. // OPTIONAL
  200. $HOOKS = array(
  201. 'VERIFY' => array(
  202. 'SUCCESS' => '',
  203. 'FAIL' => '',
  204. ),
  205. 'REQUEST' => array(
  206. 'NEW' => '',
  207. 'UNKNOWN' => '',
  208. 'ERROR' => '',
  209. ),
  210. );