pib.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or
  8. * without modification, are permitted (subject to the limitations
  9. * in the disclaimer below) provided that the following conditions
  10. * are met:
  11. *
  12. * * Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * * Redistributions in binary form must reproduce the above
  16. * copyright notice, this list of conditions and the following
  17. * disclaimer in the documentation and/or other materials
  18. * provided with the distribution.
  19. *
  20. * * Neither the name of Qualcomm Atheros nor the names of
  21. * its contributors may be used to endorse or promote products
  22. * derived from this software without specific prior written
  23. * permission.
  24. *
  25. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
  26. * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE
  27. * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  28. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  29. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
  31. * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  33. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  34. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  37. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  38. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. *--------------------------------------------------------------------*/
  41. /*====================================================================*
  42. *
  43. * pib.h - PIB version definitions and declarations;
  44. *
  45. * The PIB undergoes periodic revision as new features are added;
  46. * versions are distiguished from one another by the first two bytes;
  47. *
  48. * this file declares PIB header structure for PIBs released to
  49. * date; it does not define the position of all PIB information
  50. * because there must be some mystery to life;
  51. *
  52. * call function pibpeek() to display a buffer holding an unkown
  53. * PIB structure;
  54. *
  55. *. Qualcomm Atheros HomePlug AV Powerline Toolkit;
  56. *: Copyright (c) 2006-2010 by Intellon Corporation; ALL RIGHTS RESERVED;
  57. *; For demonstration and evaluation only; Not for production use.
  58. *
  59. * Contributor(s):
  60. * Charles Maier
  61. *
  62. *--------------------------------------------------------------------*/
  63. #ifndef PIB_HEADER
  64. #define PIB_HEADER
  65. /*====================================================================*
  66. * system header files;
  67. *--------------------------------------------------------------------*/
  68. #include <stdio.h>
  69. #include <stdint.h>
  70. #include <errno.h>
  71. #ifndef ETHER_ADDR_LEN
  72. #define ETHER_ADDR_LEN 6 /* normally defined in ethernet.h or if_ether.h */
  73. #endif
  74. /*====================================================================*
  75. * custom header files;
  76. *--------------------------------------------------------------------*/
  77. #include "../tools/types.h"
  78. #include "../tools/memory.h"
  79. #include "../key/HPAVKey.h"
  80. /*====================================================================*
  81. * constants;
  82. *--------------------------------------------------------------------*/
  83. #define PIB_NAME_LEN 32
  84. #define PIB_HFID_LEN 64
  85. #define PIB_TEXT_LEN 256
  86. #define PIB_KEY_LEN 16
  87. #define PIB_SILENCE (1 << 0)
  88. #define PIB_VERBOSE (1 << 1)
  89. #define PIB_MANIFEST (1 << 2)
  90. #define PIB_MAC (1 << 3)
  91. #define PIB_MACINC (1 << 4)
  92. #define PIB_NMK (1 << 5)
  93. #define PIB_DAK (1 << 6)
  94. #define PIB_MFGSTRING (1 << 7)
  95. #define PIB_USER (1 << 8)
  96. #define PIB_NETWORK (1 << 9)
  97. #define PIB_CCO_MODE (1 << 10)
  98. #define PIB_NID (1 << 11)
  99. #define PIB_CHECKED (1 << 12)
  100. #define INT_PRESCALER_OFFSET 0x0A10
  101. #define INT_PRESCALER_LENGTH (1155 * sizeof (uint32_t))
  102. #define AMP_PRESCALER_OFFSET 0x0A30
  103. #define AMP_PRESCALER_LENGTH ((2880 * 5) / sizeof (uint32_t))
  104. #define PLC_PRESCALER_OFFSET 0x0F2B
  105. #define PLC_PRESCALER_LENGTH (1345 / sizeof (uint32_t))
  106. #define QCA_PRESCALER_OFFSET 0x12E8
  107. #define QCA_PRESCALER_LENGTH 1345
  108. #define INDEX_TO_FREQ(index) ((float)((index)+74)/40.96)
  109. #define FREQ_TO_INDEX(freq) ((unsigned)(40.96*(freq))-74)
  110. /*====================================================================*
  111. * standard PIB message formats;
  112. *--------------------------------------------------------------------*/
  113. #define PIB_BADVERSION "%s found bad PIB version in %s", __func__
  114. #define PIB_BADCONTENT "%s found wrong PIB content in %s", __func__
  115. #define PIB_BADLENGTH "%s found wrong PIB image length in %s", __func__
  116. #define PIB_BADCHECKSUM "%s found wrong PIB image checksum in %s", __func__
  117. #define PIB_BADNID "%s found wrong Preferred NID in %s", __func__
  118. /*====================================================================*
  119. * Basic PIB header;
  120. *--------------------------------------------------------------------*/
  121. #ifndef __GNUC__
  122. #pragma pack (push, 1)
  123. #endif
  124. typedef struct __packed pib_header
  125. {
  126. uint8_t FWVERSION;
  127. uint8_t PIBVERSION;
  128. uint16_t RESERVED1;
  129. uint16_t PIBLENGTH;
  130. uint16_t RESERVED2;
  131. uint32_t CHECKSUM;
  132. }
  133. pib_header;
  134. #ifndef __GNUC__
  135. #pragma pack (pop)
  136. #endif
  137. /*====================================================================*
  138. * As of PIB 1.4 a generic structure evolved; this is the start;
  139. *--------------------------------------------------------------------*/
  140. #ifndef __GNUC__
  141. #pragma pack (push, 1)
  142. #endif
  143. typedef struct __packed simple_pib
  144. {
  145. uint16_t PIBVERSION;
  146. uint16_t RESERVED1;
  147. uint16_t PIBLENGTH;
  148. uint16_t RESERVED2;
  149. uint32_t CHECKSUM;
  150. uint8_t MAC [ETHER_ADDR_LEN];
  151. uint8_t DAK [HPAVKEY_DAK_LEN];
  152. uint16_t RESERVED3;
  153. uint8_t MFG [PIB_HFID_LEN];
  154. uint8_t NMK [HPAVKEY_NMK_LEN];
  155. uint8_t USR [PIB_HFID_LEN];
  156. uint8_t NET [PIB_HFID_LEN];
  157. uint8_t CCoSelection;
  158. uint8_t CexistModeSelect;
  159. uint8_t PLFreqSelect;
  160. uint8_t RESERVED4;
  161. uint8_t PreferredNID [HPAVKEY_NID_LEN];
  162. uint8_t AutoFWUpgradeable;
  163. uint8_t MDUConfiguration;
  164. uint8_t MDURole;
  165. uint8_t RESERVED5 [10];
  166. uint8_t StaticNetworkConfiguration [128];
  167. uint8_t InterfaceConfiguration [64];
  168. }
  169. simple_pib;
  170. #ifndef __GNUC__
  171. #pragma pack (pop)
  172. #endif
  173. /*====================================================================*
  174. *
  175. *--------------------------------------------------------------------*/
  176. #ifndef __GNUC__
  177. #pragma pack (push, 1)
  178. #endif
  179. typedef struct __packed PIB1
  180. {
  181. uint8_t FWVersion;
  182. uint8_t PIBVersion;
  183. uint16_t Reserved1;
  184. uint16_t PIBLength;
  185. }
  186. PIB1;
  187. #ifndef __GNUC__
  188. #pragma pack (pop)
  189. #endif
  190. /*====================================================================*
  191. * PIB structure as of v1.2; this is deprecated;
  192. *--------------------------------------------------------------------*/
  193. #ifndef __GNUC__
  194. #pragma pack (push, 1)
  195. #endif
  196. typedef struct __packed PIB1_2
  197. {
  198. uint8_t FWVersion;
  199. uint8_t PIBVersion;
  200. uint16_t Reserved1;
  201. uint8_t DAK [HPAVKEY_DAK_LEN];
  202. uint8_t NMK [HPAVKEY_NMK_LEN];
  203. uint8_t MAC [ETHER_ADDR_LEN];
  204. uint32_t FLG;
  205. }
  206. PIB1_2;
  207. #ifndef __GNUC__
  208. #pragma pack (pop)
  209. #endif
  210. /*====================================================================*
  211. * PIB Structure as of v1.3; this is deprecated;
  212. *--------------------------------------------------------------------*/
  213. #ifndef __GNUC__
  214. #pragma pack (push, 1)
  215. #endif
  216. typedef struct __packed PIB1_3
  217. {
  218. uint8_t FWVersion;
  219. uint8_t PIBVersion;
  220. uint16_t Reserved1;
  221. uint8_t MAC [ETHER_ADDR_LEN];
  222. uint8_t DAK [HPAVKEY_DAK_LEN];
  223. uint16_t Reserved2;
  224. uint8_t MFG [PIB_HFID_LEN];
  225. uint8_t NMK [HPAVKEY_NMK_LEN];
  226. uint8_t USR [PIB_HFID_LEN];
  227. uint8_t NET [PIB_HFID_LEN];
  228. }
  229. PIB1_3;
  230. #ifndef __GNUC__
  231. #pragma pack (pop)
  232. #endif
  233. /*====================================================================*
  234. * PIB sub-structure introduced as of v1.4
  235. *--------------------------------------------------------------------*/
  236. #ifndef __GNUC__
  237. #pragma pack (push, 1)
  238. #endif
  239. typedef struct __packed VersionHeader
  240. {
  241. uint8_t FWVersion;
  242. uint8_t PIBVersion;
  243. uint16_t Reserved1;
  244. uint16_t PIBLength;
  245. uint16_t Reserved2;
  246. uint32_t Checksum;
  247. }
  248. VersionHeader;
  249. #ifndef __GNUC__
  250. #pragma pack (pop)
  251. #endif
  252. /*====================================================================*
  253. * PIB Structure as of v1.4
  254. *--------------------------------------------------------------------*/
  255. #ifndef __GNUC__
  256. #pragma pack (push, 1)
  257. #endif
  258. typedef struct __packed PIB1_4
  259. {
  260. struct VersionHeader VersionHeader;
  261. struct __packed
  262. {
  263. uint8_t MAC [ETHER_ADDR_LEN];
  264. uint8_t DAK [HPAVKEY_DAK_LEN];
  265. uint16_t Reserved1;
  266. uint8_t MFG [PIB_HFID_LEN];
  267. uint8_t NMK [HPAVKEY_NMK_LEN];
  268. uint8_t USR [PIB_HFID_LEN];
  269. uint8_t NET [PIB_HFID_LEN];
  270. uint8_t CCoSelection;
  271. uint8_t CoexistModeSelection;
  272. uint8_t FreqSelection;
  273. uint8_t Reserved2;
  274. }
  275. LocalDeviceConfig;
  276. }
  277. PIB1_4;
  278. #ifndef __GNUC__
  279. #pragma pack (pop)
  280. #endif
  281. /*====================================================================*
  282. * PIB sub-structures introduced as of v1.5;
  283. *--------------------------------------------------------------------*/
  284. #ifndef __GNUC__
  285. #pragma pack (push, 1)
  286. #endif
  287. typedef struct __packed LocalDeviceConfig
  288. {
  289. uint8_t MAC [ETHER_ADDR_LEN];
  290. uint8_t DAK [HPAVKEY_DAK_LEN];
  291. uint16_t Reserved1;
  292. uint8_t MFG [PIB_HFID_LEN];
  293. uint8_t NMK [HPAVKEY_NMK_LEN];
  294. uint8_t USR [PIB_HFID_LEN];
  295. uint8_t NET [PIB_HFID_LEN];
  296. uint8_t CCoSelection;
  297. uint8_t CoexistModeSelect;
  298. uint8_t PLFreqSelection;
  299. uint8_t Reserved2;
  300. uint8_t PreferredNID [HPAVKEY_NID_LEN];
  301. uint8_t AutoFWUpgradeable;
  302. uint8_t MDUConfiguration;
  303. uint8_t MDURole;
  304. uint8_t Reserved3 [10];
  305. }
  306. LocalDeviceConfig;
  307. typedef struct __packed StaticNetworkConfig
  308. {
  309. uint8_t Reserved [128];
  310. }
  311. StaticNetworkConfig;
  312. typedef struct __packed InterfaceConfig
  313. {
  314. uint8_t Reserved [96];
  315. }
  316. InterfaceConfig;
  317. typedef struct __packed IGMPConfig
  318. {
  319. uint8_t Reserved [32];
  320. }
  321. IGMPConfig;
  322. typedef struct __packed QoSParameters
  323. {
  324. uint8_t UnicastPriority;
  325. uint8_t McastPriority;
  326. uint8_t IGMPPriority;
  327. uint8_t AVStreamPriority;
  328. uint32_t PriorityTTL [4];
  329. uint8_t EnableVLANOver;
  330. uint8_t EnableTOSOver;
  331. uint16_t Reserved1;
  332. uint32_t VLANPrioTOSPrecMatrix;
  333. uint8_t Reserved2 [2020];
  334. }
  335. QoSParameters;
  336. typedef struct __packed ToneNotchParameters
  337. {
  338. uint8_t Reserved [5120];
  339. }
  340. ToneNotchParameters;
  341. #ifndef __GNUC__
  342. #pragma pack (pop)
  343. #endif
  344. /*====================================================================*
  345. * PIB structure as of v1.5
  346. *--------------------------------------------------------------------*/
  347. #ifndef __GNUC__
  348. #pragma pack (push, 1)
  349. #endif
  350. typedef struct __packed PIB1_5
  351. {
  352. struct VersionHeader VersionHeader;
  353. struct LocalDeviceConfig LocalDeviceConfig;
  354. struct StaticNetworkConfig StaticNetworkConfig;
  355. struct InterfaceConfig InterfaceConfig;
  356. struct IGMPConfig IGMPConfig;
  357. struct QoSParameters QoSParameters;
  358. struct ToneNotchParameters ToneNotchParameters;
  359. }
  360. PIB1_5;
  361. #ifndef __GNUC__
  362. #pragma pack (pop)
  363. #endif
  364. /*====================================================================*
  365. * PIB sub-structures introduced as of v2.0
  366. *--------------------------------------------------------------------*/
  367. #ifndef __GNUC__
  368. #pragma pack (push, 1)
  369. #endif
  370. typedef struct __packed FeatureConfiguration
  371. {
  372. uint8_t Reserved [128];
  373. }
  374. FeatureConfiguration;
  375. #ifndef __GNUC__
  376. #pragma pack (pop)
  377. #endif
  378. /*====================================================================*
  379. * PIB structure as of v2.0
  380. *--------------------------------------------------------------------*/
  381. #ifndef __GNUC__
  382. #pragma pack (push, 1)
  383. #endif
  384. typedef struct __packed PIB2_0
  385. {
  386. struct VersionHeader VersionHeader;
  387. struct LocalDeviceConfig LocalDeviceConfig;
  388. struct StaticNetworkConfig StaticNetworkConfig;
  389. struct InterfaceConfig InterfaceConfig;
  390. struct IGMPConfig IGMPConfig;
  391. struct QoSParameters QoSParameters;
  392. struct ToneNotchParameters ToneNotchParameters;
  393. struct FeatureConfiguration FeatureConfiguration;
  394. }
  395. PIB2_0;
  396. #ifndef __GNUC__
  397. #pragma pack (pop)
  398. #endif
  399. /*====================================================================*
  400. * PIB sub-structures introduced as of v3.0;
  401. *--------------------------------------------------------------------*/
  402. #ifndef __GNUC__
  403. #pragma pack (push, 1)
  404. #endif
  405. typedef struct __packed V3_0Configuration
  406. {
  407. uint32_t AVLNMembership;
  408. uint32_t SimpleConnectTimeout;
  409. uint8_t EnableLEDThroughputIndicate;
  410. uint8_t MidLEDThroughputThreshold;
  411. uint8_t HighLEDThroughputThreshold;
  412. uint8_t Reserved1;
  413. uint32_t EnableUnicastQueriesToMembers;
  414. uint32_t DisableExpireGroupMulticastInterval;
  415. uint32_t DisableLEDTestLights;
  416. uint8_t GPIOMap [12];
  417. uint8_t Reserved [8];
  418. }
  419. V3_0Configuration;
  420. #ifndef __GNUC__
  421. #pragma pack (pop)
  422. #endif
  423. /*====================================================================*
  424. * PIB structure as of v3.0;
  425. *--------------------------------------------------------------------*/
  426. #ifndef __GNUC__
  427. #pragma pack (push, 1)
  428. #endif
  429. typedef struct __packed PIB3_0
  430. {
  431. struct VersionHeader VersionHeader;
  432. struct LocalDeviceConfig LocalDeviceConfig;
  433. struct StaticNetworkConfig StaticNetworkConfig;
  434. struct InterfaceConfig InterfaceConfig;
  435. struct IGMPConfig IGMPConfig;
  436. struct QoSParameters QoSParameters;
  437. struct ToneNotchParameters ToneNotchParameters;
  438. struct FeatureConfiguration FeatureConfiguration;
  439. struct V3_0Configuration V3_0Configuration;
  440. }
  441. PIB3_0;
  442. #ifndef __GNUC__
  443. #pragma pack (pop)
  444. #endif
  445. /*====================================================================*
  446. * PIB sub-structures introduced as of v3.1;
  447. *--------------------------------------------------------------------*/
  448. #ifndef __GNUC__
  449. #pragma pack (push, 1)
  450. #endif
  451. typedef struct __packed V3_1Configuration
  452. {
  453. uint8_t Reserved [128];
  454. }
  455. V3_1Configuration;
  456. #ifndef __GNUC__
  457. #pragma pack (pop)
  458. #endif
  459. /*====================================================================*
  460. * PIB structure as of v3.1;
  461. *--------------------------------------------------------------------*/
  462. #ifndef __GNUC__
  463. #pragma pack (push, 1)
  464. #endif
  465. typedef struct __packed PIB3_1
  466. {
  467. struct VersionHeader VersionHeader;
  468. struct LocalDeviceConfig LocalDeviceConfig;
  469. struct StaticNetworkConfig StaticNetworkConfig;
  470. struct InterfaceConfig InterfaceConfig;
  471. struct IGMPConfig IGMPConfig;
  472. struct QoSParameters QoSParameters;
  473. struct ToneNotchParameters ToneNotchParameters;
  474. struct FeatureConfiguration FeatureConfiguration;
  475. struct V3_0Configuration V3_0Configuration;
  476. struct V3_1Configuration V3_1Configuration;
  477. }
  478. PIB3_1;
  479. #ifndef __GNUC__
  480. #pragma pack (pop)
  481. #endif
  482. /*====================================================================*
  483. * PIB structure as of v3.2
  484. *--------------------------------------------------------------------*/
  485. #ifndef __GNUC__
  486. #pragma pack (push, 1)
  487. #endif
  488. typedef struct __packed PIB3_2
  489. {
  490. struct VersionHeader VersionHeader;
  491. struct LocalDeviceConfig LocalDeviceConfig;
  492. struct StaticNetworkConfig StaticNetworkConfig;
  493. struct InterfaceConfig InterfaceConfig;
  494. struct IGMPConfig IGMPConfig;
  495. struct QoSParameters QoSParameters;
  496. struct ToneNotchParameters ToneNotchParameters;
  497. struct FeatureConfiguration FeatureConfiguration;
  498. struct V3_0Configuration V3_0Configuration;
  499. struct V3_1Configuration V3_1Configuration;
  500. }
  501. PIB3_2;
  502. #ifndef __GNUC__
  503. #pragma pack (pop)
  504. #endif
  505. /*====================================================================*
  506. * PIB sub-structure introduced as of v3.3;
  507. *--------------------------------------------------------------------*/
  508. #ifndef __GNUC__
  509. #pragma pack (push, 1)
  510. #endif
  511. typedef struct __packed V3_3Configuration
  512. {
  513. uint8_t Reserved [64];
  514. }
  515. V3_3Configuration;
  516. #ifndef __GNUC__
  517. #pragma pack (pop)
  518. #endif
  519. /*====================================================================*
  520. * PIB structure as of v3.3
  521. *--------------------------------------------------------------------*/
  522. #ifndef __GNUC__
  523. #pragma pack (push, 1)
  524. #endif
  525. typedef struct __packed PIB3_3
  526. {
  527. struct VersionHeader VersionHeader;
  528. struct LocalDeviceConfig LocalDeviceConfig;
  529. struct StaticNetworkConfig StaticNetworkConfig;
  530. struct InterfaceConfig InterfaceConfig;
  531. struct IGMPConfig IGMPConfig;
  532. struct QoSParameters QoSParameters;
  533. struct ToneNotchParameters ToneNotchParameters;
  534. struct FeatureConfiguration FeatureConfiguration;
  535. struct V3_0Configuration V3_0Configuration;
  536. struct V3_1Configuration V3_1Configuration;
  537. struct V3_3Configuration V3_3Configuration;
  538. }
  539. PIB3_3;
  540. #ifndef __GNUC__
  541. #pragma pack (pop)
  542. #endif
  543. /*====================================================================*
  544. * PIB structure as of v3.4
  545. *--------------------------------------------------------------------*/
  546. #ifndef __GNUC__
  547. #pragma pack (push, 1)
  548. #endif
  549. typedef struct __packed PIB3_4
  550. {
  551. struct VersionHeader VersionHeader;
  552. struct LocalDeviceConfig LocalDeviceConfig;
  553. struct StaticNetworkConfig StaticNetworkConfig;
  554. struct InterfaceConfig InterfaceConfig;
  555. struct IGMPConfig IGMPConfig;
  556. struct QoSParameters QoSParameters;
  557. struct ToneNotchParameters ToneNotchParameters;
  558. struct FeatureConfiguration FeatureConfiguration;
  559. struct V3_0Configuration V3_0Configuration;
  560. struct V3_1Configuration V3_1Configuration;
  561. struct V3_3Configuration V3_3Configuration;
  562. }
  563. PIB3_4;
  564. #ifndef __GNUC__
  565. #pragma pack (pop)
  566. #endif
  567. /*====================================================================*
  568. * PIB sub-structure introduced as of v3.5
  569. *--------------------------------------------------------------------*/
  570. #ifndef __GNUC__
  571. #pragma pack (push, 1)
  572. #endif
  573. typedef struct __packed FeatureGroupEnablement
  574. {
  575. uint8_t Reserved [16];
  576. }
  577. FeatureGroupEnablement;
  578. #ifndef __GNUC__
  579. #pragma pack (pop)
  580. #endif
  581. /*====================================================================*
  582. * PIB structure as of v3.5
  583. *--------------------------------------------------------------------*/
  584. #ifndef __GNUC__
  585. #pragma pack (push, 1)
  586. #endif
  587. typedef struct __packed PIB3_5
  588. {
  589. struct VersionHeader VersionHeader;
  590. struct LocalDeviceConfig LocalDeviceConfig;
  591. struct StaticNetworkConfig StaticNetworkConfig;
  592. struct InterfaceConfig InterfaceConfig;
  593. struct IGMPConfig IGMPConfig;
  594. struct QoSParameters QoSParameters;
  595. struct ToneNotchParameters ToneNotchParameters;
  596. struct FeatureConfiguration FeatureConfiguration;
  597. struct V3_0Configuration V3_0Configuration;
  598. struct V3_1Configuration V3_1Configuration;
  599. struct V3_3Configuration V3_3Configuration;
  600. struct FeatureGroupEnablement FeatureGroupEnablement;
  601. }
  602. PIB3_5;
  603. #ifndef __GNUC__
  604. #pragma pack (pop)
  605. #endif
  606. /*====================================================================*
  607. * PIB structure as of v3.6
  608. *--------------------------------------------------------------------*/
  609. #ifndef __GNUC__
  610. #pragma pack (push, 1)
  611. #endif
  612. typedef struct __packed PIB3_6
  613. {
  614. struct VersionHeader VersionHeader;
  615. struct LocalDeviceConfig LocalDeviceConfig;
  616. struct StaticNetworkConfig StaticNetworkConfig;
  617. struct InterfaceConfig InterfaceConfig;
  618. struct IGMPConfig IGMPConfig;
  619. struct QoSParameters QoSParameters;
  620. struct ToneNotchParameters ToneNotchParameters;
  621. struct FeatureConfiguration FeatureConfiguration;
  622. struct V3_0Configuration V3_0Configuration;
  623. struct V3_1Configuration V3_1Configuration;
  624. struct V3_3Configuration V3_3Configuration;
  625. struct FeatureGroupEnablement FeatureGroupEnablement;
  626. }
  627. PIB3_6;
  628. #ifndef __GNUC__
  629. #pragma pack (pop)
  630. #endif
  631. /*====================================================================*
  632. * functions;
  633. *--------------------------------------------------------------------*/
  634. signed pibseek (signed fd, char const * filename, flag_t flags);
  635. signed pibfile (struct _file_ const * pib);
  636. signed pibfile1 (struct _file_ const * pib);
  637. signed pibfile2 (struct _file_ const * pib);
  638. signed piblock (struct _file_ const * pib);
  639. signed pibpeek1 (void const * memory);
  640. signed pibpeek2 (void const * memory);
  641. uint16_t pibscalers (struct _file_ * pib);
  642. uint16_t psread (uint16_t values [], uint16_t limit, FILE * fp);
  643. /*====================================================================*
  644. *
  645. *--------------------------------------------------------------------*/
  646. #endif