IxEthDB.h 109 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373
  1. /** @file IxEthDB.h
  2. *
  3. * @brief this file contains the public API of @ref IxEthDB component
  4. *
  5. *
  6. * @par
  7. * IXP400 SW Release version 2.0
  8. *
  9. * -- Copyright Notice --
  10. *
  11. * @par
  12. * Copyright 2001-2005, Intel Corporation.
  13. * All rights reserved.
  14. *
  15. * @par
  16. * Redistribution and use in source and binary forms, with or without
  17. * modification, are permitted provided that the following conditions
  18. * are met:
  19. * 1. Redistributions of source code must retain the above copyright
  20. * notice, this list of conditions and the following disclaimer.
  21. * 2. Redistributions in binary form must reproduce the above copyright
  22. * notice, this list of conditions and the following disclaimer in the
  23. * documentation and/or other materials provided with the distribution.
  24. * 3. Neither the name of the Intel Corporation nor the names of its contributors
  25. * may be used to endorse or promote products derived from this software
  26. * without specific prior written permission.
  27. *
  28. * @par
  29. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  30. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  33. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  34. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  35. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  36. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  37. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  38. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  39. * SUCH DAMAGE.
  40. *
  41. * @par
  42. * -- End of Copyright Notice --
  43. *
  44. */
  45. #ifndef IxEthDB_H
  46. #define IxEthDB_H
  47. #include <IxOsBuffMgt.h>
  48. #include <IxTypes.h>
  49. /**
  50. * @defgroup IxEthDB IXP400 Ethernet Database (IxEthDB) API
  51. *
  52. * @brief ethDB is a library that does provides a MAC address database learning/filtering capability
  53. *
  54. *@{
  55. */
  56. #define INLINE __inline__
  57. #define IX_ETH_DB_PRIVATE PRIVATE /* imported from IxTypes.h */
  58. #define IX_ETH_DB_PUBLIC PUBLIC
  59. /**
  60. * @brief port ID => message handler NPE id conversion (0 => NPE_B, 1 => NPE_C)
  61. */
  62. #define IX_ETH_DB_PORT_ID_TO_NPE(id) (id == 0 ? 1 : (id == 1 ? 2 : (id == 2 ? 0 : -1)))
  63. /**
  64. * @def IX_ETH_DB_NPE_TO_PORT_ID(npe)
  65. * @brief message handler NPE id => port ID conversion (NPE_B => 0, NPE_C => 1)
  66. */
  67. #define IX_ETH_DB_NPE_TO_PORT_ID(npe) (npe == 0 ? 2 : (npe == 1 ? 0 : (npe == 2 ? 1 : -1)))
  68. /* temporary define - won't work for Azusa */
  69. #define IX_ETH_DB_PORT_ID_TO_NPE_LOGICAL_ID(id) (IX_ETH_DB_PORT_ID_TO_NPE(id) << 4)
  70. #define IX_ETH_DB_NPE_LOGICAL_ID_TO_PORT_ID(id) (IX_ETH_DB_NPE_TO_PORT_ID(id >> 4))
  71. /**
  72. * @def IX_IEEE803_MAC_ADDRESS_SIZE
  73. * @brief The size of the MAC address
  74. */
  75. #define IX_IEEE803_MAC_ADDRESS_SIZE (6)
  76. /**
  77. * @def IX_IEEE802_1Q_QOS_PRIORITY_COUNT
  78. * @brief Number of QoS priorities defined by IEEE802.1Q
  79. */
  80. #define IX_IEEE802_1Q_QOS_PRIORITY_COUNT (8)
  81. /**
  82. * @enum IxEthDBStatus
  83. * @brief Ethernet Database API return values
  84. */
  85. typedef enum /* IxEthDBStatus */
  86. {
  87. IX_ETH_DB_SUCCESS = IX_SUCCESS, /**< Success */
  88. IX_ETH_DB_FAIL = IX_FAIL, /**< Failure */
  89. IX_ETH_DB_INVALID_PORT, /**< Invalid port */
  90. IX_ETH_DB_PORT_UNINITIALIZED, /**< Port not initialized */
  91. IX_ETH_DB_MAC_UNINITIALIZED, /**< MAC not initialized */
  92. IX_ETH_DB_INVALID_ARG, /**< Invalid argument */
  93. IX_ETH_DB_NO_SUCH_ADDR, /**< Address not found for search or delete operations */
  94. IX_ETH_DB_NOMEM, /**< Learning database memory full */
  95. IX_ETH_DB_BUSY, /**< Learning database cannot complete operation, access temporarily blocked */
  96. IX_ETH_DB_END, /**< Database browser passed the end of the record set */
  97. IX_ETH_DB_INVALID_VLAN, /**< Invalid VLAN ID (valid range is 0..4094, 0 signifies no VLAN membership, used for priority tagged frames) */
  98. IX_ETH_DB_INVALID_PRIORITY, /**< Invalid QoS priority/traffic class (valid range for QoS priority is 0..7, valid range for traffic class depends on run-time configuration) */
  99. IX_ETH_DB_NO_PERMISSION, /**< No permission for attempted operation */
  100. IX_ETH_DB_FEATURE_UNAVAILABLE, /**< Feature not available (or not enabled) */
  101. IX_ETH_DB_INVALID_KEY, /**< Invalid search key */
  102. IX_ETH_DB_INVALID_RECORD_TYPE /**< Invalid record type */
  103. } IxEthDBStatus;
  104. /** @brief VLAN ID type, valid range is 0..4094, 0 signifying no VLAN membership */
  105. typedef UINT32 IxEthDBVlanId;
  106. /** @brief 802.1Q VLAN tag, contains 3 bits user priority, 1 bit CFI, 12 bits VLAN ID */
  107. typedef UINT32 IxEthDBVlanTag;
  108. /** @brief QoS priority/traffic class type, valid range is 0..7, 0 being the lowest */
  109. typedef UINT32 IxEthDBPriority;
  110. /** @brief Priority mapping table; 0..7 QoS priorities used to index, table contains traffic classes */
  111. typedef UINT8 IxEthDBPriorityTable[8];
  112. /** @brief A 4096 bit array used to map the complete VLAN ID range */
  113. typedef UINT8 IxEthDBVlanSet[512];
  114. #define IX_ETH_DB_802_1Q_VLAN_MASK (0xFFF)
  115. #define IX_ETH_DB_802_1Q_QOS_MASK (0x7)
  116. #define IX_ETH_DB_802_1Q_MAX_VLAN_ID (0xFFE)
  117. /**
  118. * @def IX_ETH_DB_SET_VLAN_ID
  119. * @brief returns the given 802.1Q tag with the VLAN ID field substituted with the given VLAN ID
  120. *
  121. * This macro is used to change the VLAN ID in a 802.1Q tag.
  122. *
  123. * Example:
  124. *
  125. * tag = IX_ETH_DB_SET_VLAN_ID(tag, 32)
  126. *
  127. * inserts the VLAN ID "32" in the given tag.
  128. */
  129. #define IX_ETH_DB_SET_VLAN_ID(vlanTag, vlanID) (((vlanTag) & 0xF000) | ((vlanID) & IX_ETH_DB_802_1Q_VLAN_MASK))
  130. /**
  131. * @def IX_ETH_DB_GET_VLAN_ID
  132. * @brief returns the VLAN ID from the given 802.1Q tag
  133. */
  134. #define IX_ETH_DB_GET_VLAN_ID(vlanTag) ((vlanTag) & IX_ETH_DB_802_1Q_VLAN_MASK)
  135. #define IX_ETH_DB_GET_QOS_PRIORITY(vlanTag) (((vlanTag) >> 13) & IX_ETH_DB_802_1Q_QOS_MASK)
  136. #define IX_ETH_DB_SET_QOS_PRIORITY(vlanTag, priority) (((vlanTag) & 0x1FFF) | (((priority) & IX_ETH_DB_802_1Q_QOS_MASK) << 13))
  137. #define IX_ETH_DB_CHECK_VLAN_TAG(vlanTag) { if(((vlanTag & 0xFFFF0000) != 0) || (IX_ETH_DB_GET_VLAN_ID(vlanTag) > 4094)) return IX_ETH_DB_INVALID_VLAN; }
  138. #define IX_ETH_DB_CHECK_VLAN_ID(vlanId) { if (vlanId > IX_ETH_DB_802_1Q_MAX_VLAN_ID) return IX_ETH_DB_INVALID_VLAN; }
  139. #define IX_IEEE802_1Q_VLAN_TPID (0x8100)
  140. typedef enum
  141. {
  142. IX_ETH_DB_UNTAGGED_FRAMES = 0x1, /**< Accepts untagged frames */
  143. IX_ETH_DB_VLAN_TAGGED_FRAMES = 0x2, /**< Accepts tagged frames */
  144. IX_ETH_DB_PRIORITY_TAGGED_FRAMES = 0x4, /**< Accepts tagged frames with VLAN ID set to 0 (no VLAN membership) */
  145. IX_ETH_DB_ACCEPT_ALL_FRAMES =
  146. IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_VLAN_TAGGED_FRAMES /**< Accepts all the frames */
  147. } IxEthDBFrameFilter;
  148. typedef enum
  149. {
  150. IX_ETH_DB_PASS_THROUGH = 0x1, /**< Leave frame as-is */
  151. IX_ETH_DB_ADD_TAG = 0x2, /**< Add default port VLAN tag */
  152. IX_ETH_DB_REMOVE_TAG = 0x3 /**< Remove VLAN tag from frame */
  153. } IxEthDBTaggingAction;
  154. typedef enum
  155. {
  156. IX_ETH_DB_FIREWALL_WHITE_LIST = 0x1, /**< Firewall operates in white-list mode (MAC address based admission) */
  157. IX_ETH_DB_FIREWALL_BLACK_LIST = 0x2 /**< Firewall operates in black-list mode (MAC address based blocking) */
  158. } IxEthDBFirewallMode;
  159. typedef enum
  160. {
  161. IX_ETH_DB_FILTERING_RECORD = 0x01, /**< <table><caption> Filtering record </caption>
  162. * <tr><td> MAC address <td> static/dynamic type <td> age
  163. * </table>
  164. */
  165. IX_ETH_DB_FILTERING_VLAN_RECORD = 0x02, /**< <table><caption> VLAN-enabled filtering record </caption>
  166. * <tr><td> MAC address <td> static/dynamic type <td> age <td> 802.1Q tag
  167. * </table>
  168. */
  169. IX_ETH_DB_WIFI_RECORD = 0x04, /**< <table><caption> WiFi header conversion record </caption>
  170. * <tr><td> MAC address <td> optional gateway MAC address <td>
  171. * </table>
  172. */
  173. IX_ETH_DB_FIREWALL_RECORD = 0x08, /**< <table><caption> Firewall record </caption>
  174. * <tr><td> MAC address
  175. * </table>
  176. */
  177. IX_ETH_DB_GATEWAY_RECORD = 0x10, /**< <i>For internal use only</i> */
  178. IX_ETH_DB_MAX_RECORD_TYPE_INDEX = 0x10, /**< <i>For internal use only</i> */
  179. IX_ETH_DB_NO_RECORD_TYPE = 0, /**< None of the registered record types */
  180. IX_ETH_DB_ALL_FILTERING_RECORDS = IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_FILTERING_VLAN_RECORD, /**< All the filtering records */
  181. IX_ETH_DB_ALL_RECORD_TYPES = IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_FILTERING_VLAN_RECORD |
  182. IX_ETH_DB_WIFI_RECORD | IX_ETH_DB_FIREWALL_RECORD /**< All the record types registered within EthDB */
  183. } IxEthDBRecordType;
  184. typedef enum
  185. {
  186. IX_ETH_DB_LEARNING = 0x01, /**< Learning feature; enables EthDB to learn MAC address (filtering) records, including 802.1Q enabled records */
  187. IX_ETH_DB_FILTERING = 0x02, /**< Filtering feature; enables EthDB to communicate with the NPEs for downloading filtering information in the NPEs; depends on the learning feature */
  188. IX_ETH_DB_VLAN_QOS = 0x04, /**< VLAN/QoS feature; enables EthDB to configure NPEs to operate in VLAN/QoS aware modes */
  189. IX_ETH_DB_FIREWALL = 0x08, /**< Firewall feature; enables EthDB to configure NPEs to operate in firewall mode, using white/black address lists */
  190. IX_ETH_DB_SPANNING_TREE_PROTOCOL = 0x10, /**< Spanning tree protocol feature; enables EthDB to configure the NPEs as STP nodes */
  191. IX_ETH_DB_WIFI_HEADER_CONVERSION = 0x20 /**< WiFi 802.3 to 802.11 header conversion feature; enables EthDB to handle WiFi conversion data */
  192. } IxEthDBFeature;
  193. typedef UINT32 IxEthDBProperty; /**< Property ID type */
  194. typedef enum
  195. {
  196. IX_ETH_DB_INTEGER_PROPERTY = 0x1, /**< 4 byte unsigned integer type */
  197. IX_ETH_DB_STRING_PROPERTY = 0x2, /**< NULL-terminated string type of maximum 255 characters (including the terminator) */
  198. IX_ETH_DB_MAC_ADDR_PROPERTY = 0x3, /**< 6 byte MAC address type */
  199. IX_ETH_DB_BOOL_PROPERTY = 0x4 /**< 4 byte boolean type; can contain only TRUE and FALSE values */
  200. } IxEthDBPropertyType;
  201. /* list of supported properties for the IX_ETH_DB_VLAN_QOS feature */
  202. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_COUNT_PROPERTY (0x01) /**< Property identifying number the supported number of traffic classes */
  203. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_0_RX_QUEUE_PROPERTY (0x10) /**< Rx queue assigned to traffic class 0 */
  204. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_1_RX_QUEUE_PROPERTY (0x11) /**< Rx queue assigned to traffic class 1 */
  205. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_2_RX_QUEUE_PROPERTY (0x12) /**< Rx queue assigned to traffic class 2 */
  206. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_3_RX_QUEUE_PROPERTY (0x13) /**< Rx queue assigned to traffic class 3 */
  207. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_4_RX_QUEUE_PROPERTY (0x14) /**< Rx queue assigned to traffic class 4 */
  208. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_5_RX_QUEUE_PROPERTY (0x15) /**< Rx queue assigned to traffic class 5 */
  209. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_6_RX_QUEUE_PROPERTY (0x16) /**< Rx queue assigned to traffic class 6 */
  210. #define IX_ETH_DB_QOS_TRAFFIC_CLASS_7_RX_QUEUE_PROPERTY (0x17) /**< Rx queue assigned to traffic class 7 */
  211. /* private property used by EthAcc to indicate queue configuration complete */
  212. #define IX_ETH_DB_QOS_QUEUE_CONFIGURATION_COMPLETE (0x18)
  213. /**
  214. *
  215. * @brief The IEEE 802.3 Ethernet MAC address structure.
  216. *
  217. * The data should be packed with bytes xx:xx:xx:xx:xx:xx
  218. *
  219. * @note The data must be packed in network byte order.
  220. */
  221. typedef struct
  222. {
  223. UINT8 macAddress[IX_IEEE803_MAC_ADDRESS_SIZE];
  224. } IxEthDBMacAddr;
  225. /**
  226. * @ingroup IxEthDB
  227. *
  228. * @brief Definition of an IXP400 port.
  229. */
  230. typedef UINT32 IxEthDBPortId;
  231. /**
  232. * @ingroup IxEthDB
  233. *
  234. * @brief Port dependency map definition
  235. */
  236. typedef UINT8 IxEthDBPortMap[32];
  237. /**
  238. * @ingroup IxEthDB
  239. *
  240. * @fn IxEthDBStatus ixEthDBInit(void)
  241. *
  242. * @brief Initializes the Ethernet learning/filtering database
  243. *
  244. * @note calling this function multiple times does not constitute an error;
  245. * redundant calls will be ignored, returning IX_ETH_DB_SUCCESS
  246. *
  247. * @retval IX_ETH_DB_SUCCESS initialization was successful
  248. * @retval IX_ETH_DB_FAIL initialization failed (OS error)
  249. */
  250. IX_ETH_DB_PUBLIC
  251. IxEthDBStatus ixEthDBInit(void);
  252. /**
  253. * @ingroup IxEthDB
  254. *
  255. * @fn IxEthDBStatus ixEthDBUnload(void)
  256. *
  257. * @brief Stops and prepares the EthDB component for unloading.
  258. *
  259. * @retval IX_ETH_DB_SUCCESS de-initialization was successful
  260. * @retval IX_ETH_DB_BUSY de-initialization failed, ports must be disabled first
  261. * @retval IX_ETH_DB_FAIL de-initialization failed (OS error)
  262. */
  263. IX_ETH_DB_PUBLIC
  264. IxEthDBStatus ixEthDBUnload(void);
  265. /**
  266. * @ingroup IxEthDB
  267. *
  268. * @fn void ixEthDBPortInit(IxEthDBPortId portID)
  269. *
  270. * @brief Initializes a port
  271. *
  272. * This function is called automatically by the Ethernet Access
  273. * ixEthAccPortInit() routine for Ethernet NPE ports and should be manually
  274. * called for any user-defined port (any port that is not one of
  275. * the two Ethernet NPEs).
  276. *
  277. * @param portID @ref IxEthDBPortId [in] - ID of the port to be initialized
  278. *
  279. * @see IxEthDBPortDefs.h for port definitions
  280. *
  281. * @note calling this function multiple times does not constitute an error;
  282. * redundant calls will be ignored
  283. */
  284. IX_ETH_DB_PUBLIC
  285. void ixEthDBPortInit(IxEthDBPortId portID);
  286. /**
  287. * @ingroup IxEthDB
  288. *
  289. * @fn IxEthDBStatus ixEthDBPortEnable(IxEthDBPortId portID)
  290. *
  291. * @brief Enables a port
  292. *
  293. * This function is called automatically from the Ethernet Access component
  294. * ixEthAccPortEnable() routine for Ethernet NPE ports and should be manually
  295. * called for any user-defined port (any port that is not one of
  296. * the Ethernet NPEs).
  297. *
  298. * @param portID @ref IxEthDBPortId [in] - ID of the port to enable processing on
  299. *
  300. * @retval IX_ETH_DB_SUCCESS if enabling is successful
  301. * @retval IX_ETH_DB_FAIL if the enabling was not successful due to
  302. * a message handler error
  303. * @retval IX_ETH_DB_MAC_UNINITIALIZED the MAC address of this port was
  304. * not initialized (only for Ethernet NPEs)
  305. * @retval IX_ETH_DB_INVALID_PORT if portID is invalid
  306. *
  307. * @pre ixEthDBPortAddressSet needs to be called prior to enabling the port events
  308. * for Ethernet NPEs
  309. *
  310. * @see ixEthDBPortAddressSet
  311. *
  312. * @see IxEthDBPortDefs.h for port definitions
  313. *
  314. * @note calling this function multiple times does not constitute an error;
  315. * redundant calls will be ignored
  316. */
  317. IX_ETH_DB_PUBLIC
  318. IxEthDBStatus ixEthDBPortEnable(IxEthDBPortId portID);
  319. /**
  320. * @ingroup IxEthDB
  321. *
  322. * @fn IxEthDBStatus ixEthDBPortDisable(IxEthDBPortId portID)
  323. *
  324. * @brief Disables processing on a port
  325. *
  326. * This function is called automatically from the Ethernet Access component
  327. * ixEthAccPortDisable() routine for Ethernet NPE ports and should be manually
  328. * called for any user-defined port (any port that is not one of
  329. * the Ethernet NPEs).
  330. *
  331. * @note Calling ixEthAccPortDisable() will disable the respective Ethernet NPE.
  332. * After Ethernet NPEs are disabled they are stopped therefore
  333. * when re-enabled they need to be reset, downloaded with microcode and started.
  334. * For learning to restart working the user needs to call again
  335. * ixEthAccPortUnicastMacAddressSet or ixEthDBUnicastAddressSet
  336. * with the respective port MAC address.
  337. * Residual MAC addresses learnt before the port was disabled are deleted as soon
  338. * as the port is disabled. This only applies to dynamic (learnt) entries, static
  339. * entries do not dissapear when the port is disabled.
  340. *
  341. * @param portID @ref IxEthDBPortId [in] - ID of the port to disable processing on
  342. *
  343. * @retval IX_ETH_DB_SUCCESS if disabling is successful
  344. * @retval IX_ETH_DB_FAIL if the disabling was not successful due to
  345. * a message handler error
  346. * @retval IX_ETH_DB_INVALID_PORT if portID is invalid
  347. *
  348. * @note calling this function multiple times after the first time completed successfully
  349. * does not constitute an error; redundant calls will be ignored and return IX_ETH_DB_SUCCESS
  350. */
  351. IX_ETH_DB_PUBLIC
  352. IxEthDBStatus ixEthDBPortDisable(IxEthDBPortId portID);
  353. /**
  354. * @ingroup IxEthDB
  355. *
  356. * @fn IxEthDBStatus ixEthDBPortAddressSet(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  357. *
  358. * @brief Sets the port MAC address
  359. *
  360. * This function is to be called from the Ethernet Access component top-level
  361. * ixEthDBUnicastAddressSet(). Event processing cannot be enabled for a port
  362. * until its MAC address has been set.
  363. *
  364. * @param portID @ref IxEthDBPortId [in] - ID of the port whose MAC address is set
  365. * @param macAddr @ref IxEthDBMacAddr [in] - port MAC address
  366. *
  367. * @retval IX_ETH_DB_SUCCESS MAC address was set successfully
  368. * @retval IX_ETH_DB_FAIL MAC address was not set due to a message handler failure
  369. * @retval IX_ETH_DB_INVALID_PORT if the port is not an Ethernet NPE
  370. *
  371. * @see IxEthDBPortDefs.h for port definitions
  372. */
  373. IX_ETH_DB_PUBLIC
  374. IxEthDBStatus ixEthDBPortAddressSet(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  375. /**
  376. * @ingroup IxEthDB
  377. *
  378. * @fn IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize)
  379. *
  380. * @brief Set the maximum frame size supported on the given port ID
  381. *
  382. * This functions set the maximum frame size supported on a specific port ID
  383. *
  384. * - Reentrant - yes
  385. * - ISR Callable - no
  386. *
  387. * @param portID @ref IxEthDBPortId [in] - port ID to configure
  388. * @param maximumFrameSize UINT32 [in] - maximum frame size to configure
  389. *
  390. * @retval IX_ETH_DB_SUCCESS the port is configured
  391. * @retval IX_ETH_DB_PORT_UNINITIALIZED the port has not been initialized
  392. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  393. * @retval IX_ETH_DB_INVALID_ARG size parameter is out of range
  394. * @retval IX_ETH_DB_NO_PERMISSION selected port is not an Ethernet NPE
  395. * @retval IX_FAIL unknown OS or NPE communication error
  396. *
  397. * @note
  398. * This maximum frame size is used to filter the frames based on their
  399. * destination addresses and the capabilities of the destination port.
  400. * The mximum value that can be set for a NPE port is 16320.
  401. * (IX_ETHNPE_ACC_FRAME_LENGTH_MAX)
  402. */
  403. IX_ETH_DB_PUBLIC
  404. IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize);
  405. /**
  406. * @ingroup IxEthDB
  407. *
  408. * @fn IxEthDBStatus ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  409. *
  410. * @brief Populate the Ethernet learning/filtering database with a static MAC address
  411. *
  412. * Populates the Ethernet learning/filtering database with a static MAC address. The entry will not be subject to aging.
  413. * If there is an entry (static or dynamic) with the corresponding MAC address on any port this entry will take precedence.
  414. * Any other entry with the same MAC address will be removed.
  415. *
  416. * - Reentrant - yes
  417. * - ISR Callable - yes
  418. *
  419. * @param portID @ref IxEthDBPortId [in] - port ID to add the static address to
  420. * @param macAddr @ref IxEthDBMacAddr [in] - static MAC address to add
  421. *
  422. * @retval IX_ETH_DB_SUCCESS the add was successful
  423. * @retval IX_ETH_DB_FAIL failed to populate the database entry
  424. * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later
  425. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  426. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  427. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  428. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
  429. */
  430. IX_ETH_DB_PUBLIC
  431. IxEthDBStatus ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  432. /**
  433. * @ingroup IxEthDB
  434. *
  435. * @fn IxEthDBStatus ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  436. *
  437. * @brief Populate the Ethernet learning/filtering database with a dynamic MAC address
  438. *
  439. * Populates the Ethernet learning/filtering database with a dynamic MAC address. This entry will be subject to normal
  440. * aging function, if aging is enabled on its port.
  441. * If there is an entry (static or dynamic) with the same MAC address on any port this entry will take precedence.
  442. * Any other entry with the same MAC address will be removed.
  443. *
  444. * - Reentrant - yes
  445. * - ISR Callable - yes
  446. *
  447. * @param portID @ref IxEthDBPortId [in] - port ID to add the dynamic address to
  448. * @param macAddr @ref IxEthDBMacAddr [in] - static MAC address to add
  449. *
  450. * @retval IX_ETH_DB_SUCCESS the add was successful
  451. * @retval IX_ETH_DB_FAIL failed to populate the database entry
  452. * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later
  453. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  454. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  455. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  456. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
  457. */
  458. IX_ETH_DB_PUBLIC
  459. IxEthDBStatus ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  460. /**
  461. * @ingroup IxEthDB
  462. *
  463. * @fn IxEthDBStatus ixEthDBFilteringEntryDelete(IxEthDBMacAddr *macAddr)
  464. *
  465. * @brief Removes a MAC address entry from the Ethernet learning/filtering database
  466. *
  467. * @param macAddr IxEthDBMacAddr [in] - MAC address to remove
  468. *
  469. * - Reentrant - yes
  470. * - ISR Callable - no
  471. *
  472. * @retval IX_ETH_DB_SUCCESS the removal was successful
  473. * @retval IX_ETH_DB_NO_SUCH_ADDR failed to remove the address (not in the database)
  474. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  475. * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later
  476. */
  477. IX_ETH_DB_PUBLIC
  478. IxEthDBStatus ixEthDBFilteringEntryDelete(IxEthDBMacAddr *macAddr);
  479. /**
  480. * @ingroup IxEthDB
  481. *
  482. * @fn IxEthDBStatus ixEthDBFilteringPortSearch(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  483. *
  484. * @brief Search the Ethernet learning/filtering database for the given MAC address and port ID
  485. *
  486. * This functions searches the database for a specific port ID and MAC address. Both the port ID
  487. * and the MAC address have to match in order for the record to be reported as found.
  488. *
  489. * - Reentrant - yes
  490. * - ISR Callable - no
  491. *
  492. * @param portID @ref IxEthDBPortId [in] - port ID to search for
  493. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to search for
  494. *
  495. * @retval IX_ETH_DB_SUCCESS the record exists in the database
  496. * @retval IX_ETH_DB_INVALID_ARG invalid macAddr pointer argument
  497. * @retval IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database
  498. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  499. * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
  500. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
  501. */
  502. IX_ETH_DB_PUBLIC
  503. IxEthDBStatus ixEthDBFilteringPortSearch(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  504. /**
  505. * @ingroup IxEthDB
  506. *
  507. * @fn IxEthDBStatus ixEthDBFilteringDatabaseSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr)
  508. *
  509. * @brief Search the Ethernet learning/filtering database for a MAC address and return the port ID
  510. *
  511. * Searches the database for a MAC address. The function returns the portID for the
  512. * MAC address record, if found. If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR.
  513. * The portID is only valid if the function finds a match.
  514. *
  515. * - Reentrant - yes
  516. * - ISR Callable - no
  517. *
  518. * @param portID @ref IxEthDBPortId [in] - port ID the address belongs to (populated only on a successful search)
  519. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to search for
  520. *
  521. * @retval IX_ETH_DB_SUCCESS the record exists in the database
  522. * @retval IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database
  523. * @retval IX_ETH_DB_INVALID_ARG invalid macAddr or portID pointer argument(s)
  524. */
  525. IX_ETH_DB_PUBLIC
  526. IxEthDBStatus ixEthDBFilteringDatabaseSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr);
  527. /**
  528. * @ingroup IxEthDB
  529. *
  530. * @fn IxEthDBStatus ixEthDBFilteringPortUpdatingSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr)
  531. *
  532. * @brief Search the filtering database for a MAC address, return the port ID and reset the record age
  533. *
  534. * Searches the database for a MAC address. The function returns the portID for the
  535. * MAC address record and resets the entry age to 0, if found.
  536. * If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR.
  537. * The portID is only valid if the function finds a match.
  538. *
  539. * - Reentrant - yes
  540. * - ISR Callable - no
  541. *
  542. * @retval IX_ETH_DB_SUCCESS the MAC address was found
  543. * @retval IX_ETH_DB_NO_SUCH_ADDR the MAC address was not found
  544. * @retval IX_ETH_DB_INVALID_ARG invalid macAddr or portID pointer argument(s)
  545. */
  546. IX_ETH_DB_PUBLIC
  547. IxEthDBStatus ixEthDBFilteringPortUpdatingSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr);
  548. /**
  549. * @ingroup IxEthDB
  550. *
  551. * @def IX_ETH_DB_MAINTENANCE_TIME
  552. *
  553. * @brief The @ref ixEthDBDatabaseMaintenance must be called by the user at a frequency of
  554. * IX_ETH_DB_MAINTENANCE_TIME
  555. *
  556. */
  557. #define IX_ETH_DB_MAINTENANCE_TIME (1 * 60) /* 1 Minute */
  558. /**
  559. * @ingroup IxEthDB
  560. *
  561. * @def IX_ETH_DB_LEARNING_ENTRY_AGE_TIME
  562. *
  563. * @brief The define specifies the filtering database age entry time. Static entries older than
  564. * IX_ETH_DB_LEARNING_ENTRY_AGE_TIME +/- IX_ETH_DB_MAINTENANCE_TIME shall be removed.
  565. *
  566. */
  567. #define IX_ETH_DB_LEARNING_ENTRY_AGE_TIME (15 * 60 ) /* 15 Mins */
  568. /**
  569. * @ingroup IxEthDB
  570. *
  571. * @fn IxEthDBStatus ixEthDBPortAgingDisable(IxEthDBPortId portID)
  572. *
  573. * @brief Disable the aging function for a specific port
  574. *
  575. * @param portID @ref IxEthDBPortId [in] - port ID to disable aging on
  576. *
  577. * - Reentrant - yes
  578. * - ISR Callable - no
  579. *
  580. * @retval IX_ETH_DB_SUCCESS aging disabled successfully
  581. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  582. * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
  583. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
  584. */
  585. IX_ETH_DB_PUBLIC
  586. IxEthDBStatus ixEthDBPortAgingDisable(IxEthDBPortId portID);
  587. /**
  588. * @ingroup IxEthDB
  589. *
  590. * @fn IxEthDBStatus ixEthDBPortAgingEnable(IxEthDBPortId portID)
  591. *
  592. * @brief Enable the aging function for a specific port
  593. *
  594. * Enables the aging of dynamic MAC address entries stored in the learning/filtering database
  595. *
  596. * @note The aging function relies on the @ref ixEthDBDatabaseMaintenance being called with a period of
  597. * @ref IX_ETH_DB_MAINTENANCE_TIME seconds.
  598. *
  599. * - Reentrant - yes
  600. * - ISR Callable - no
  601. *
  602. * @param portID @ref IxEthDBPortId [in] - port ID to enable aging on
  603. *
  604. * @retval IX_ETH_DB_SUCCESS aging enabled successfully
  605. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  606. * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
  607. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
  608. */
  609. IX_ETH_DB_PUBLIC
  610. IxEthDBStatus ixEthDBPortAgingEnable(IxEthDBPortId portID);
  611. /**
  612. * @ingroup IxEthDB
  613. *
  614. * @fn void ixEthDBDatabaseMaintenance(void)
  615. *
  616. * @brief Performs a maintenance operation on the Ethernet learning/filtering database
  617. *
  618. * In order to perform a database maintenance this function must be called every
  619. * @ref IX_ETH_DB_MAINTENANCE_TIME seconds. It should be called regardless of whether learning is
  620. * enabled or not.
  621. *
  622. * - Reentrant - no
  623. * - ISR Callable - no
  624. *
  625. * @note this function call will be ignored if the learning feature is disabled
  626. */
  627. IX_ETH_DB_PUBLIC
  628. void ixEthDBDatabaseMaintenance(void);
  629. /**
  630. * @ingroup IxEthDB
  631. *
  632. * @fn IxEthDBStatus ixEthDBFilteringDatabaseShow(IxEthDBPortId portID)
  633. *
  634. * @brief This function displays the Mac Ethernet MAC address filtering tables.
  635. *
  636. * It displays the MAC address, port ID, entry type (dynamic/static),and age for
  637. * the given port ID.
  638. *
  639. * - Reentrant - no
  640. * - ISR Callable - no
  641. *
  642. * @param portID @ref IxEthDBPortId [in] - port ID to display the MAC address entries
  643. *
  644. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  645. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  646. * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
  647. * @retval IX_ETH_DB_FAIL record browser failed due to an internal busy or lock condition
  648. *
  649. * @note this function is deprecated and kept for compatibility reasons; use @ref ixEthDBFilteringDatabaseShowRecords instead
  650. *
  651. * @see ixEthDBFilteringDatabaseShowRecords
  652. */
  653. IX_ETH_DB_PUBLIC
  654. IxEthDBStatus ixEthDBFilteringDatabaseShow(IxEthDBPortId portID);
  655. /**
  656. * @ingroup IxEthDB
  657. *
  658. * @fn void ixEthDBFilteringDatabaseShowAll(void)
  659. *
  660. * @brief Displays the MAC address recorded in the filtering database for all registered
  661. * ports (see IxEthDBPortDefs.h), grouped by port ID.
  662. *
  663. * - Reentrant - no
  664. * - ISR Callable - no
  665. *
  666. * @retval void
  667. *
  668. * @note this function is deprecated and kept for compatibility reasons; use @ref ixEthDBFilteringDatabaseShowRecords instead
  669. *
  670. * @see ixEthDBFilteringDatabaseShowRecords
  671. */
  672. IX_ETH_DB_PUBLIC
  673. void ixEthDBFilteringDatabaseShowAll(void);
  674. /**
  675. * @ingroup IxEthDB
  676. *
  677. * @fn IxEthDBStatus ixEthDBFilteringDatabaseShowRecords(IxEthDBPortId portID, IxEthDBRecordType recordFilter)
  678. *
  679. * @brief This function displays per port database records, given a record type filter
  680. *
  681. * The supported record type filters are:
  682. *
  683. * - IX_ETH_DB_FILTERING_RECORD - displays the non-VLAN filtering records (MAC address, age, static/dynamic)
  684. * - IX_ETH_DB_FILTERING_VLAN_RECORD - displays the VLAN filtering records (MAC address, age, static/dynamic, VLAN ID, CFI, QoS class)
  685. * - IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_FILTERING_VLAN_RECORD - displays the previous two types of records
  686. * - IX_ETH_DB_WIFI_RECORD - displays the WiFi header conversion records (MAC address, optional gateway MAC address) and WiFi header conversion parameters (BBSID, Duration/ID)
  687. * - IX_ETH_DB_FIREWALL_RECORD - displays the firewall MAC address table and firewall operating mode (white list/black list)
  688. * - IX_ETH_DB_ALL_RECORD_TYPES - displays all the record types
  689. * - IX_ETH_DB_NO_RECORD_TYPE - displays only the port status (no records are displayed)
  690. *
  691. * Additionally, the status of each port will be displayed, containg the following information: type, capabilities, enabled status,
  692. * aging enabled status, group membership and maximum frame size.
  693. *
  694. * The port ID can either be an actual port or IX_ETH_DB_ALL_PORTS, in which case the requested information
  695. * will be displayed for all the ports (grouped by port)
  696. *
  697. * - Reentrant - no
  698. * - ISR Callable - no
  699. *
  700. * @param portID ID of the port to display information on (use IX_ETH_DB_ALL_PORTS for all the ports)
  701. * @param recordFilter record type filter
  702. *
  703. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  704. * @retval IX_ETH_DB_INVALID_PORT portID is invalid
  705. * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
  706. */
  707. IX_ETH_DB_PUBLIC
  708. IxEthDBStatus ixEthDBFilteringDatabaseShowRecords(IxEthDBPortId portID, IxEthDBRecordType recordFilter);
  709. /**
  710. * @ingroup IxEthDB
  711. *
  712. * @fn IxEthDBStatus ixEthDBPortDependencyMapSet(IxEthDBPortId portID, IxEthDBPortMap dependencyPortMap)
  713. *
  714. * @brief Sets the dependency port map for a port
  715. *
  716. * @param portID ID of the port to set the dependency map to
  717. * @param dependencyPortMap new dependency map (as bitmap, each bit set indicates a port being included)
  718. *
  719. * This function is used to share filtering information between ports.
  720. * By adding a port into another port's dependency map the target port
  721. * filtering data will import the filtering data from the port it depends on.
  722. * Any changes to filtering data for a port - such as adding, updating or removing records -
  723. * will trigger updates in the filtering information for all the ports depending on
  724. * on the updated port.
  725. *
  726. * For example, if ports 2 and 3 are set in the port 0 dependency map the filtering
  727. * information for port 0 will also include the filtering information from ports 2 and 3.
  728. * Adding a record to port 2 will also trigger an update not only on port 2 but also on
  729. * port 0.
  730. *
  731. * The dependency map is a 256 bit array where each bit corresponds to a port corresponding to the
  732. * bit offset (bit 0 - port 0, bit 1 - port 1 etc). Setting a bit to 1 indicates that the corresponding
  733. * port is the port map. For example, a dependency port map of 0x14 consists in the ports with IDs 2 and 4.
  734. * Note that the last bit (offset 255) is reserved and should never be set (it will be automatically
  735. * cleared by the function).
  736. *
  737. * By default, each port has a dependency port map consisting only of itself, i.e.
  738. *
  739. * @verbatim
  740. IxEthDBPortMap portMap;
  741. /* clear all ports from port map */
  742. memset(portMap, 0, sizeof (portMap));
  743. /* include portID in port map */
  744. portMap[portID / 8] = 1 << (portID % 8);
  745. @endverbatim
  746. *
  747. * - Reentrant - no
  748. * - ISR Callable - no
  749. *
  750. * @note Setting dependency maps is useful for NPE ports, which benefit from automatic updates
  751. * of filtering information. Setting dependency maps for user-defined ports is not an error
  752. * but will have no actual effect.
  753. *
  754. * @note Including a port in its own dependency map is not compulsory, however note that
  755. * in this case updating the port will not trigger an update on the port itself, which
  756. * might not be the intended behavior
  757. *
  758. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  759. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  760. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  761. * @retval IX_ETH_DB_INVALID_ARG invalid <i>dependencyPortMap</i> pointer
  762. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Filtering is not available or not enabled for the port
  763. */
  764. IX_ETH_DB_PUBLIC
  765. IxEthDBStatus ixEthDBPortDependencyMapSet(IxEthDBPortId portID, IxEthDBPortMap dependencyPortMap);
  766. /**
  767. * @ingroup IxEthDB
  768. *
  769. * @fn IxEthDBStatus ixEthDBPortDependencyMapGet(IxEthDBPortId portID, IxEthDBPortMap dependencyPortMap)
  770. *
  771. * @brief Retrieves the dependency port map for a port
  772. *
  773. * @param portID ID of the port to set the dependency map to
  774. * @param dependencyPortMap location where the port dependency map is to be copied
  775. *
  776. * This function will copy the port dependency map to a user specified location.
  777. *
  778. * - Reentrant - no
  779. * - ISR Callable - no
  780. *
  781. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  782. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  783. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  784. * @retval IX_ETH_DB_INVALID_ARG invalid <i>dependencyPortMap</i> pointer
  785. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Filtering is not available or not enabled for the port
  786. */
  787. IX_ETH_DB_PUBLIC
  788. IxEthDBStatus ixEthDBPortDependencyMapGet(IxEthDBPortId portID, IxEthDBPortMap dependencyPortMap);
  789. /**
  790. * @ingroup IxEthDB
  791. *
  792. * @fn IxEthDBStatus ixEthDBPortVlanTagSet(IxEthDBPortId portID, IxEthDBVlanTag vlanTag)
  793. *
  794. * @brief Sets the default 802.1Q VLAN tag for a given port
  795. *
  796. * @param portID @ref IxEthDBPortId [in] - ID of the port to set the default VLAN tag to
  797. * @param vlanTag @ref IxEthDBVlanTag [in] - default 802.1Q VLAN tag
  798. *
  799. * The tag format has 16 bits and it is defined in the IEEE802.1Q specification.
  800. * This tag will be used for tagging untagged frames (if enabled) and classifying
  801. * unexpedited traffic into an internal traffic class (using the user priority field).
  802. *
  803. * <table border="1"> <caption> 802.1Q tag format </caption>
  804. * <tr> <td> <b> 3 bits <td> <b> 1 bit <td> <b> 12 bits </b>
  805. * <tr> <td> user priority <td> CFI <td> VID
  806. * </table>
  807. *
  808. * User Priority : Defines user priority, giving eight (2^3) priority levels. IEEE 802.1P defines
  809. * the operation for these 3 user priority bits
  810. *
  811. * CFI : Canonical Format Indicator is always set to zero for Ethernet switches. CFI is used for
  812. * compatibility reason between Ethernet type network and Token Ring type network. If a frame received
  813. * at an Ethernet port has a CFI set to 1, then that frame should not be forwarded as it is to an untagged port.
  814. *
  815. * VID : VLAN ID is the identification of the VLAN, which is basically used by the standard 802.1Q.
  816. * It has 12 bits and allow the id entification of 4096 (2^12) VLANs. Of the 4096 possible VIDs, a VID of 0
  817. * is used to identify priority frames and value 4095 (FFF) is reserved, so the maximum possible VLAN
  818. * configurations are 4,094.
  819. *
  820. * - Reentrant - no
  821. * - ISR Callable - no
  822. *
  823. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  824. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  825. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  826. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  827. * @retval IX_ETH_DB_INVALID_VLAN <i>vlanTag</i> argument does not parse to a valid 802.1Q VLAN tag
  828. *
  829. * @note a VLAN ID value of 0 indicates that the port is not part of any VLAN
  830. * @note the value of the cannonical frame indicator (CFI) field is ignored, the
  831. * field being used only in frame tagging operations
  832. */
  833. IX_ETH_DB_PUBLIC
  834. IxEthDBStatus ixEthDBPortVlanTagSet(IxEthDBPortId portID, IxEthDBVlanTag vlanTag);
  835. /**
  836. * @ingroup IxEthDB
  837. *
  838. * @fn IxEthDBStatus ixEthDBPortVlanTagGet(IxEthDBPortId portID, IxEthDBVlanTag *vlanTag)
  839. *
  840. * @brief Retrieves the default 802.1Q port VLAN tag for a given port (see also @ref ixEthDBPortVlanTagSet)
  841. *
  842. * @param portID @ref IxEthDBPortId [in] - ID of the port to retrieve the default VLAN tag from
  843. * @param vlanTag @ref IxEthDBVlanTag [out] - location to write the default port 802.1Q VLAN tag to
  844. *
  845. * - Reentrant - no
  846. * - ISR Callable - no
  847. *
  848. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  849. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  850. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  851. * @retval IX_ETH_DB_INVALID_ARG invalid vlanTag pointer
  852. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  853. */
  854. IX_ETH_DB_PUBLIC
  855. IxEthDBStatus ixEthDBPortVlanTagGet(IxEthDBPortId portID, IxEthDBVlanTag *vlanTag);
  856. /**
  857. * @ingroup IxEthDB
  858. *
  859. * @fn IxEthDBStatus ixEthDBVlanTagSet(IxEthDBMacAddr *macAddr, IxEthDBVlanTag vlanTag)
  860. *
  861. * @brief Sets the 802.1Q VLAN tag for a database record
  862. *
  863. * @param macAddr MAC address
  864. * @param vlanTag 802.1Q VLAN tag
  865. *
  866. * This function is used together with @ref ixEthDBVlanTagGet to provide MAC-based VLAN classification support.
  867. * Please note that the bridging application must contain specific code to make use of this feature (see below).
  868. *
  869. * VLAN tags can be set only in IX_ETH_DB_FILTERING_RECORD or IX_ETH_DB_FILTERING_VLAN_RECORD type records.
  870. * If to an IX_ETH_DB_FILTERING_RECORD type record is added a VLAN tag the record type is automatically
  871. * changed to IX_ETH_DB_FILTERING_VLAN_RECORD. Once this has occurred the record type will never
  872. * revert to a non-VLAN type (unless deleted and re-added).
  873. *
  874. * Record types used for different purposes (such as IX_ETH_DB_WIFI_RECORD) will be ignored by
  875. * this function.
  876. *
  877. * After using this function to associate a VLAN ID with a MAC address the VLAN ID can be extracted knowing the
  878. * MAC address using @ref ixEthDBVlanTagGet. This mechanism can be used to implement MAC-based VLAN classification
  879. * if a bridging application searches for the VLAN tag when receiving a frame based on the source MAC address
  880. * (contained in the <i>ixp_ne_src_mac</i> field of the buffer header).
  881. * If found in the database, the application can instruct the NPE to tag the frame by writing the VLAN tag
  882. * in the <i>ixp_ne_vlan_tci</i> field of the buffer header. This way the NPE will inspect the Egress tagging
  883. * rule associated with the given VLAN ID on the Tx port and tag the frame if Egress tagging on the VLAN is
  884. * allowed. Additionally, Egress tagging can be forced by setting the <i>ixp_ne_tx_flags.tag_over</i> and
  885. * <i>ixp_ne_tx_flags.tag_mode</i> flags in the buffer header.
  886. *
  887. * - Reentrant - no
  888. * - ISR Callable - no
  889. *
  890. * @note this function will <b>not</b> add a filtering record, it can only be used to update an existing one
  891. *
  892. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  893. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer
  894. * @retval IX_ETH_DB_NO_SUCH_ADDR a filtering record with the specified MAC address was not found
  895. * @retval IX_ETH_DB_INVALID_VLAN <i>vlanTag</i> argument does not parse to a valid 802.1Q VLAN tag
  896. */
  897. IX_ETH_DB_PUBLIC
  898. IxEthDBStatus ixEthDBVlanTagSet(IxEthDBMacAddr *macAddr, IxEthDBVlanTag vlanTag);
  899. /**
  900. * @ingroup IxEthDB
  901. *
  902. * @fn ixEthDBVlanTagGet(IxEthDBMacAddr *macAddr, IxEthDBVlanTag *vlanTag)
  903. *
  904. * @brief Retrieves the 802.1Q VLAN tag from a database record given the record MAC address
  905. *
  906. * @param macAddr MAC address
  907. * @param vlanTag location to write the record 802.1Q VLAN tag to
  908. *
  909. * @note VLAN tags can be retrieved only from IX_ETH_DB_FILTERING_VLAN_RECORD type records
  910. *
  911. * This function is used together with ixEthDBVlanTagSet to provide MAC-based VLAN classification support.
  912. * Please note that the bridging application must contain specific code to make use of this feature (see @ref ixEthDBVlanTagSet).
  913. *
  914. * - Reentrant - no
  915. * - ISR Callable - no
  916. *
  917. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  918. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> or <i>vlanTag</i> pointer
  919. * @retval IX_ETH_DB_NO_SUCH_ADDR a filtering record with the specified MAC address was not found
  920. */
  921. IX_ETH_DB_PUBLIC
  922. IxEthDBStatus ixEthDBVlanTagGet(IxEthDBMacAddr *macAddr, IxEthDBVlanTag *vlanTag);
  923. /**
  924. * @ingroup IxEthDB
  925. *
  926. * @fn IxEthDBStatus ixEthDBPortVlanMembershipAdd(IxEthDBPortId portID, IxEthDBVlanId vlanID)
  927. *
  928. * @brief Adds a VLAN ID to a port's VLAN membership table
  929. *
  930. * Adding a VLAN ID to a port's VLAN membership table will cause frames tagged with the specified
  931. * VLAN ID to be accepted by the frame filter, if Ingress VLAN membership filtering is enabled.
  932. *
  933. * - Reentrant - no
  934. * - ISR Callable - no
  935. *
  936. * @param portID @ref IxEthDBPortId [in] - ID of the port to add the VLAN ID membership to
  937. * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID to be added to the port membership table
  938. *
  939. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  940. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  941. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  942. * @retval IX_ETH_DB_INVALID_VLAN vlanID is not a valid VLAN ID
  943. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  944. * @retval IX_FAIL unknown OS or NPE communication error
  945. *
  946. * @note A port's default VLAN ID is always in its own membership table, hence there
  947. * is no need to explicitly add it using this function (although it is not an error
  948. * to do so)
  949. */
  950. IX_ETH_DB_PUBLIC
  951. IxEthDBStatus ixEthDBPortVlanMembershipAdd(IxEthDBPortId portID, IxEthDBVlanId vlanID);
  952. /**
  953. * @ingroup IxEthDB
  954. *
  955. * @fn IxEthDBStatus ixEthDBPortVlanMembershipRangeAdd(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax)
  956. *
  957. * @brief Adds a VLAN ID range to a port's VLAN membership table
  958. *
  959. * All the VLAN IDs in the specified range will be added to the port VLAN
  960. * membership table, including the range start and end VLAN IDs. Tagged frames with
  961. * VLAN IDs in the specified range will be accepted by the frame filter, if Ingress VLAN
  962. * membership filtering is enabled.
  963. *
  964. * - Reentrant - no
  965. * - ISR Callable - no
  966. *
  967. * @param portID @ref IxEthDBPortId [in] - port ID to add the VLAN membership range into
  968. * @param vlanIDMin @ref IxEthDBVlanId [in] - start of the VLAN ID range
  969. * @param vlanIDMax @ref IxEthDBVlanId [in] - end of the VLAN ID range
  970. *
  971. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  972. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  973. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  974. * @retval IX_ETH_DB_INVALID_VLAN the specified VLAN IDs are invalid or do not constitute a range
  975. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  976. * @retval IX_FAIL unknown OS or NPE communication error
  977. *
  978. * @note Is is valid to use the same VLAN ID for both vlanIDMin and vlanIDMax, in which case this
  979. * function will behave as @ref ixEthDBPortVlanMembershipAdd
  980. *
  981. * @note A port's default VLAN ID is always in its own membership table, hence there is no need
  982. * to explicitly add it using this function (although it is not an error to do so)
  983. */
  984. IX_ETH_DB_PUBLIC
  985. IxEthDBStatus ixEthDBPortVlanMembershipRangeAdd(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax);
  986. /**
  987. * @ingroup IxEthDB
  988. *
  989. * @fn IxEthDBStatus ixEthDBPortVlanMembershipRemove(IxEthDBPortId portID, IxEthDBVlanId vlanID)
  990. *
  991. * @brief Removes a VLAN ID from a port's VLAN membership table
  992. *
  993. * Frames tagged with a VLAN ID which is not in a port's VLAN membership table
  994. * will be discarded by the frame filter, if Ingress membership filtering is enabled.
  995. *
  996. * - Reentrant - no
  997. * - ISR Callable - no
  998. *
  999. * @param portID @ref IxEthDBPortId [in] - ID of the port to remove the VLAN ID membership from
  1000. * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID to be removed from the port membership table
  1001. *
  1002. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1003. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1004. * @retval IX_ETH_DB_INVALID_VLAN vlanID is not a valid VLAN ID
  1005. * @retval IX_ETH_DB_NO_PERMISSION attempted to remove the default VLAN ID
  1006. * from the port membership table (vlanID was set to the default port VLAN ID)
  1007. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1008. * @retval IX_FAIL unknown OS or NPE communication error
  1009. *
  1010. * @note A port's default VLAN ID cannot be removed from the port's membership
  1011. * table; attempting it will return IX_ETH_DB_NO_PERMISSION
  1012. */
  1013. IX_ETH_DB_PUBLIC
  1014. IxEthDBStatus ixEthDBPortVlanMembershipRemove(IxEthDBPortId portID, IxEthDBVlanId vlanID);
  1015. /**
  1016. * @ingroup IxEthDB
  1017. *
  1018. * @fn IxEthDBStatus ixEthDBPortVlanMembershipRangeRemove(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax)
  1019. *
  1020. * @brief Removes a VLAN ID range from a port's VLAN membership table
  1021. *
  1022. * All the VLAN IDs in the specified range will be removed from the port VLAN
  1023. * membership table, including the range start and end VLAN IDs. Tagged frames
  1024. * with VLAN IDs in the range will be discarded by the frame filter, if Ingress
  1025. * membership filtering is enabled.
  1026. *
  1027. * - Reentrant - no
  1028. * - ISR Callable - no
  1029. *
  1030. * @param portID @ref IxEthDBPortId [in] - ID of the port to remove the VLAN membership range from
  1031. * @param vlanIDMin @ref IxEthDBVlanId [in] - start of the VLAN ID range
  1032. * @param vlanIDMax @ref IxEthDBVlanId [in] - end of the VLAN ID range
  1033. *
  1034. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1035. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1036. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1037. * @retval IX_ETH_DB_INVALID_VLAN the specified VLAN IDs are invalid or do not constitute a range
  1038. * @retval IX_ETH_DB_NO_PERMISSION attempted to remove the default VLAN ID
  1039. * from the port membership table (both vlanIDMin and vlanIDMax were set to the default port VLAN ID)
  1040. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1041. * @retval IX_FAIL unknown OS or NPE communication error
  1042. *
  1043. * @note Is is valid to use the same VLAN ID for both vlanIDMin and vlanIDMax, in which case
  1044. * function will behave as @ref ixEthDBPortVlanMembershipRemove
  1045. *
  1046. * @note If the given range overlaps the default port VLAN ID this function
  1047. * will remove all the VLAN IDs in the range except for the port VLAN ID from its
  1048. * own membership table. This situation will be silently dealt with (no error message
  1049. * will be returned) as long as the range contains more than one value (i.e. at least
  1050. * one other value, apart from the default port VLAN ID). If the function is called
  1051. * with the vlanIDMin and vlanIDMax parameters both set to the port default VLAN ID, the
  1052. * function will infer that an attempt was specifically made to remove the default port
  1053. * VLAN ID from the port membership table, in which case the return value will be
  1054. * IX_ETH_DB_NO_PERMISSION.
  1055. */
  1056. IX_ETH_DB_PUBLIC
  1057. IxEthDBStatus ixEthDBPortVlanMembershipRangeRemove(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax);
  1058. /**
  1059. * @ingroup IxEthDB
  1060. *
  1061. * @fn IxEthDBStatus ixEthDBPortVlanMembershipSet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
  1062. *
  1063. * @brief Sets a port's VLAN membership table
  1064. *
  1065. * Sets a port's VLAN membership table from a complete VLAN table containing all the possible
  1066. * 4096 VLAN IDs. The table format is an array containing 4096 bits (512 bytes), where each bit
  1067. * indicates whether the VLAN at that bit index is in the port's membership list (if set) or
  1068. * not (unset).
  1069. *
  1070. * The bit at index 0, indicating VLAN ID 0, indicates no VLAN membership and therefore no
  1071. * other bit must be set if bit 0 is set.
  1072. *
  1073. * The bit at index 4095 is reserved and should never be set (it will be ignored if set).
  1074. *
  1075. * The bit referencing the same VLAN ID as the default port VLAN ID should always be set, as
  1076. * the membership list must contain at least the default port VLAN ID.
  1077. *
  1078. * - Reentrant - no
  1079. * - ISR Callable - no
  1080. *
  1081. * @param portID @ref IxEthDBPortId [in] - port ID to set the VLAN membership table to
  1082. * @param vlanSet @ref IxEthDBVlanSet [in] - pointer to the VLAN membership table
  1083. *
  1084. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1085. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1086. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1087. * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
  1088. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1089. * @retval IX_FAIL unknown OS or NPE communication error
  1090. */
  1091. IX_ETH_DB_PUBLIC
  1092. IxEthDBStatus ixEthDBPortVlanMembershipSet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet);
  1093. /**
  1094. * @ingroup IxEthDB
  1095. *
  1096. * @fn IxEthDBStatus ixEthDBPortVlanMembershipGet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
  1097. *
  1098. * @brief Retrieves a port's VLAN membership table
  1099. *
  1100. * Retrieves the complete VLAN membership table from a port, containing all the possible
  1101. * 4096 VLAN IDs. The table format is an array containing 4096 bits (512 bytes), where each bit
  1102. * indicates whether the VLAN at that bit index is in the port's membership list (if set) or
  1103. * not (unset).
  1104. *
  1105. * The bit at index 0, indicating VLAN ID 0, indicates no VLAN membership and therefore no
  1106. * other bit will be set if bit 0 is set.
  1107. *
  1108. * The bit at index 4095 is reserved and will not be set (it will be ignored if set).
  1109. *
  1110. * The bit referencing the same VLAN ID as the default port VLAN ID will always be set, as
  1111. * the membership list must contain at least the default port VLAN ID.
  1112. *
  1113. * - Reentrant - no
  1114. * - ISR Callable - no
  1115. *
  1116. * @param portID @ref IxEthDBPortId [in] - port ID to retrieve the VLAN membership table from
  1117. * @param vlanSet @ref IxEthDBVlanSet [out] - pointer a location where the VLAN membership table will be
  1118. * written to
  1119. *
  1120. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1121. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1122. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1123. * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
  1124. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1125. */
  1126. IX_ETH_DB_PUBLIC
  1127. IxEthDBStatus ixEthDBPortVlanMembershipGet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet);
  1128. /**
  1129. * @ingroup IxEthDB
  1130. *
  1131. * @fn IxEthDBStatus ixEthDBAcceptableFrameTypeSet(IxEthDBPortId portID, IxEthDBFrameFilter frameFilter)
  1132. *
  1133. * @brief Sets a port's acceptable frame type filter
  1134. *
  1135. * The acceptable frame type is one (or a combination) of the following values:
  1136. * - IX_ETH_DB_ACCEPT_ALL_FRAMES - accepts all the frames
  1137. * - IX_ETH_DB_UNTAGGED_FRAMES - accepts untagged frames
  1138. * - IX_ETH_DB_VLAN_TAGGED_FRAMES - accepts tagged frames
  1139. * - IX_ETH_DB_PRIORITY_TAGGED_FRAMES - accepts tagged frames with VLAN ID set to 0 (no VLAN membership)
  1140. *
  1141. * Except for using the exact values given above only the following combinations are valid:
  1142. * - IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_VLAN_TAGGED_FRAMES
  1143. * - IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_PRIORITY_TAGGED_FRAMES
  1144. *
  1145. * Please note that IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_VLAN_TAGGED_FRAMES is equivalent
  1146. * to IX_ETH_DB_ACCEPT_ALL_FRAMES.
  1147. *
  1148. * - Reentrant - no
  1149. * - ISR Callable - no
  1150. *
  1151. * @note by default the acceptable frame type filter is set to IX_ETH_DB_ACCEPT_ALL_FRAMES
  1152. *
  1153. * @note setting the acceptable frame type to PRIORITY_TAGGED_FRAMES is internally
  1154. * accomplished by changing the frame filter to VLAN_TAGGED_FRAMES and setting the
  1155. * VLAN membership list to include only VLAN ID 0; the membership list will need
  1156. * to be restored manually to an appropriate value if the acceptable frame type
  1157. * filter is changed back to ACCEPT_ALL_FRAMES or VLAN_TAGGED_FRAMES; failure to do so
  1158. * will filter all VLAN traffic bar frames tagged with VLAN ID 0
  1159. *
  1160. * @param portID @ref IxEthDBPortId [in] - port ID to set the acceptable frame type filter to
  1161. * @param frameFilter @ref IxEthDBFrameFilter [in] - acceptable frame type filter
  1162. *
  1163. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1164. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1165. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1166. * @retval IX_ETH_DB_INVALID_ARG invalid frame type filter
  1167. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1168. * @retval IX_FAIL unknown OS or NPE communication error
  1169. */
  1170. IX_ETH_DB_PUBLIC
  1171. IxEthDBStatus ixEthDBAcceptableFrameTypeSet(IxEthDBPortId portID, IxEthDBFrameFilter frameFilter);
  1172. /**
  1173. * @ingroup IxEthDB
  1174. *
  1175. * @fn IxEthDBStatus ixEthDBAcceptableFrameTypeGet(IxEthDBPortId portID, IxEthDBFrameFilter *frameFilter)
  1176. *
  1177. * @brief Retrieves a port's acceptable frame type filter
  1178. *
  1179. * For a description of the acceptable frame types see @ref ixEthDBAcceptableFrameTypeSet
  1180. *
  1181. * - Reentrant - no
  1182. * - ISR Callable - no
  1183. *
  1184. * @param portID @ref IxEthDBPortId [in] - port ID to retrieve the acceptable frame type filter from
  1185. * @param frameFilter @ref IxEthDBFrameFilter [out] - location to store the acceptable frame type filter
  1186. *
  1187. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1188. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1189. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1190. * @retval IX_ETH_DB_INVALID_ARG invalid <i>frameFilter</i> pointer argument
  1191. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1192. */
  1193. IX_ETH_DB_PUBLIC
  1194. IxEthDBStatus ixEthDBAcceptableFrameTypeGet(IxEthDBPortId portID, IxEthDBFrameFilter *frameFilter);
  1195. /**
  1196. * @ingroup IxEthDB
  1197. *
  1198. * @fn IxEthDBStatus ixEthDBPriorityMappingTableSet(IxEthDBPortId portID, IxEthDBPriorityTable priorityTable)
  1199. *
  1200. * @brief Sets a port's priority mapping table
  1201. *
  1202. * The priority mapping table is an 8x2 table mapping a QoS (user) priority into an internal
  1203. * traffic class. There are 8 valid QoS priorities (0..7, 0 being the lowest) which can be
  1204. * mapped into one of the 4 available traffic classes (0..3, 0 being the lowest).
  1205. * If a custom priority mapping table is not specified using this function the following
  1206. * default priority table will be used (as per IEEE 802.1Q and IEEE 802.1D):
  1207. *
  1208. * <table border="1"> <caption> QoS traffic classes </caption>
  1209. * <tr> <td> <b> QoS priority <td> <b> Default traffic class <td> <b> Traffic type </b>
  1210. * <tr> <td> 0 <td> 1 <td> Best effort, default class for unexpedited traffic
  1211. * <tr> <td> 1 <td> 0 <td> Background traffic
  1212. * <tr> <td> 2 <td> 0 <td> Spare bandwidth
  1213. * <tr> <td> 3 <td> 1 <td> Excellent effort
  1214. * <tr> <td> 4 <td> 2 <td> Controlled load
  1215. * <tr> <td> 5 <td> 2 <td> Video traffic
  1216. * <tr> <td> 6 <td> 3 <td> Voice traffic
  1217. * <tr> <td> 7 <td> 3 <td> Network control
  1218. * </table>
  1219. *
  1220. * - Reentrant - no
  1221. * - ISR Callable - no
  1222. *
  1223. * @param portID @ref IxEthDBPortId [in] - port ID of the port to set the priority mapping table to
  1224. * @param priorityTable @ref IxEthDBPriorityTable [in] - location of the user priority table
  1225. *
  1226. * @note The provided table will be copied into internal data structures in EthDB and
  1227. * can be deallocated by the called after this function has completed its execution, if
  1228. * so desired
  1229. *
  1230. * @warning The number of available traffic classes differs depending on the NPE images
  1231. * and queue configuration. Check IxEthDBQoS.h for up-to-date information on the availability of
  1232. * traffic classes. Note that specifiying a traffic class in the priority map which exceeds
  1233. * the system availability will produce an IX_ETH_DB_INVALID_PRIORITY return error code and no
  1234. * priority will be remapped.
  1235. *
  1236. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1237. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1238. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1239. * @retval IX_ETH_DB_INVALID_ARG invalid <i>priorityTable</i> pointer
  1240. * @retval IX_ETH_DB_INVALID_PRIORITY at least one priority value exceeds
  1241. * the current number of available traffic classes
  1242. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1243. * @retval IX_FAIL unknown OS or NPE communication error
  1244. */
  1245. IX_ETH_DB_PUBLIC
  1246. IxEthDBStatus ixEthDBPriorityMappingTableSet(IxEthDBPortId portID, IxEthDBPriorityTable priorityTable);
  1247. /**
  1248. * @ingroup IxEthDB
  1249. *
  1250. * @fn IxEthDBStatus ixEthDBPriorityMappingTableGet(IxEthDBPortId portID, IxEthDBPriorityTable priorityTable)
  1251. *
  1252. * @brief Retrieves a port's priority mapping table
  1253. *
  1254. * The priority mapping table for the given port will be copied in the location
  1255. * specified by the caller using "priorityTable"
  1256. *
  1257. * - Reentrant - no
  1258. * - ISR Callable - no
  1259. *
  1260. * @param portID ID @ref IxEthDBPortId [in] - of the port to retrieve the priority mapping table from
  1261. * @param priorityTable @ref IxEthDBPriorityTable [out] - pointer to a user specified location where the table will be copied to
  1262. *
  1263. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1264. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1265. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1266. * @retval IX_ETH_DB_INVALID_ARG invalid priorityTable pointer
  1267. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1268. */
  1269. IX_ETH_DB_PUBLIC
  1270. IxEthDBStatus ixEthDBPriorityMappingTableGet(IxEthDBPortId portID, IxEthDBPriorityTable priorityTable);
  1271. /**
  1272. * @ingroup IxEthDB
  1273. *
  1274. * @fn IxEthDBStatus ixEthDBPriorityMappingClassSet(IxEthDBPortId portID, IxEthDBPriority userPriority, IxEthDBPriority trafficClass)
  1275. *
  1276. * @brief Sets one QoS/user priority => traffic class mapping in a port's priority mapping table
  1277. *
  1278. * This function establishes a mapping between a user (QoS) priority and an internal traffic class.
  1279. * The mapping will be saved in the port's priority mapping table. Use this function when not all
  1280. * the QoS priorities need remapping (see also @ref ixEthDBPriorityMappingTableSet)
  1281. *
  1282. * - Reentrant - no
  1283. * - ISR Callable - no
  1284. *
  1285. * @param portID @ref IxEthDBPortId [in] - ID of the port to set the mapping to
  1286. * @param userPriority @ref IxEthDBPriority [in] - user (QoS) priority, between 0 and 7 (0 being the lowest)
  1287. * @param trafficClass @ref IxEthDBPriority [in] - internal traffic class, between 0 and 3 (0 being the lowest)
  1288. *
  1289. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1290. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1291. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1292. * @retval IX_ETH_DB_INVALID_PRIORITY <i>userPriority</i> out of range or
  1293. * <i>trafficClass</i> is beyond the number of currently available traffic classes
  1294. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1295. * @retval IX_FAIL unknown OS or NPE communication error
  1296. */
  1297. IX_ETH_DB_PUBLIC
  1298. IxEthDBStatus ixEthDBPriorityMappingClassSet(IxEthDBPortId portID, IxEthDBPriority userPriority, IxEthDBPriority trafficClass);
  1299. /**
  1300. * @ingroup IxEthDB
  1301. *
  1302. * @fn IxEthDBStatus ixEthDBPriorityMappingClassGet(IxEthDBPortId portID, IxEthDBPriority userPriority, IxEthDBPriority *trafficClass)
  1303. *
  1304. * @brief Retrieves one QoS/user priority => traffic class mapping in a port's priority mapping table
  1305. *
  1306. * This function retrieves the internal traffic class associated with a QoS (user) priority from a given
  1307. * port's priority mapping table. Use this function when not all the QoS priority mappings are
  1308. * required (see also @ref ixEthDBPriorityMappingTableGet)
  1309. *
  1310. * - Reentrant - no
  1311. * - ISR Callable - no
  1312. *
  1313. * @param portID @ref IxEthDBPortId [in] - ID of the port to set the mapping to
  1314. * @param userPriority @ref IxEthDBPriority [in] - user (QoS) priority, between 0 and 7 (0 being the lowest)
  1315. * @param trafficClass @ref IxEthDBPriority [out] - location to write the corresponding internal traffic class to
  1316. *
  1317. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1318. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1319. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1320. * @retval IX_ETH_DB_INVALID_PRIORITY invalid userPriority value (out of range)
  1321. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1322. * @retval IX_ETH_DB_INVALID_ARG invalid <i>trafficClass</i> pointer argument
  1323. */
  1324. IX_ETH_DB_PUBLIC
  1325. IxEthDBStatus ixEthDBPriorityMappingClassGet(IxEthDBPortId portID, IxEthDBPriority userPriority, IxEthDBPriority *trafficClass);
  1326. /**
  1327. * @ingroup IxEthDB
  1328. *
  1329. * @fn IxEthDBStatus ixEthDBEgressVlanEntryTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanId vlanID, BOOL enabled)
  1330. *
  1331. * @brief Enables or disables Egress VLAN tagging for a port and a given VLAN
  1332. *
  1333. * This function enables or disables Egress VLAN tagging for the given port and VLAN ID.
  1334. * If the VLAN tagging for a certain VLAN ID is enabled then all the frames to be
  1335. * transmitted on the given port tagged with the same VLAN ID will be transmitted in a tagged format.
  1336. * If tagging is not enabled for the given VLAN ID, the VLAN tag from the frames matching
  1337. * this VLAN ID will be removed (the frames will be untagged).
  1338. *
  1339. * VLAN ID 4095 is reserved and should never be used with this function.
  1340. * VLAN ID 0 has the special meaning of "No VLAN membership" and it is used in this
  1341. * context to allow the port to send priority-tagged frames or not.
  1342. *
  1343. * By default, no Egress VLAN tagging is enabled on any port.
  1344. *
  1345. * - Reentrant - no
  1346. * - ISR Callable - no
  1347. *
  1348. * @param portID @ref IxEthDBPortId [in] - ID of the port to enable or disable the VLAN ID Egress tagging on
  1349. * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID to be matched against outgoing frames
  1350. * @param enabled BOOL [in] - TRUE to enable Egress VLAN tagging on the port and given VLAN, and
  1351. * FALSE to disable Egress VLAN tagging
  1352. *
  1353. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1354. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1355. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1356. * @retval IX_ETH_DB_INVALID_VLAN invalid VLAN ID (out of range)
  1357. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1358. * @retval IX_FAIL unknown OS or NPE communication error
  1359. */
  1360. IX_ETH_DB_PUBLIC
  1361. IxEthDBStatus ixEthDBEgressVlanEntryTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanId vlanID, BOOL enabled);
  1362. /**
  1363. * @ingroup IxEthDB
  1364. *
  1365. * @fn IxEthDBStatus ixEthDBEgressVlanEntryTaggingEnabledGet(IxEthDBPortId portID, IxEthDBVlanId vlanID, BOOL *enabled)
  1366. *
  1367. * @brief Retrieves the Egress VLAN tagging enabling status for a port and VLAN ID
  1368. *
  1369. * @param portID [in] - ID of the port to extract the Egress VLAN ID tagging status from
  1370. * @param vlanID VLAN [in] - ID whose tagging status is to be extracted
  1371. * @param enabled [in] - user-specifed location where the status is copied to; following
  1372. * the successfull execution of this function the value will be TRUE if Egress VLAN
  1373. * tagging is enabled for the given port and VLAN ID, and FALSE otherwise
  1374. *
  1375. * - Reentrant - no
  1376. * - ISR Callable - no
  1377. *
  1378. * @see ixEthDBEgressVlanEntryTaggingEnabledGet
  1379. *
  1380. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1381. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1382. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1383. * @retval IX_ETH_DB_INVALID_VLAN invalid VLAN ID (out of range)
  1384. * @retval IX_ETH_DB_INVALID_ARG invalid <i>enabled</i> argument pointer
  1385. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1386. */
  1387. IX_ETH_DB_PUBLIC
  1388. IxEthDBStatus ixEthDBEgressVlanEntryTaggingEnabledGet(IxEthDBPortId portID, IxEthDBVlanId vlanID, BOOL *enabled);
  1389. /**
  1390. * @ingroup IxEthDB
  1391. *
  1392. * @fn IxEthDBStatus ixEthDBEgressVlanRangeTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax, BOOL enabled)
  1393. *
  1394. * @brief Enables or disables Egress VLAN tagging for a port and given VLAN range
  1395. *
  1396. * This function is very similar to @ref ixEthDBEgressVlanEntryTaggingEnabledSet with the
  1397. * difference that it can manipulate the Egress tagging status on multiple VLAN IDs,
  1398. * defined by a contiguous range. Note that both limits in the range are explicitly
  1399. * included in the execution of this function.
  1400. *
  1401. * - Reentrant - no
  1402. * - ISR Callable - no
  1403. *
  1404. * @param portID @ref IxEthDBPortId [in] - ID of the port to enable or disable the VLAN ID Egress tagging on
  1405. * @param vlanIDMin @ref IxEthDBVlanId [in] - start of the VLAN range to be matched against outgoing frames
  1406. * @param vlanIDMax @ref IxEthDBVlanId [in] - end of the VLAN range to be matched against outgoing frames
  1407. * @param enabled BOOL [in] - TRUE to enable Egress VLAN tagging on the port and given VLAN range,
  1408. * and FALSE to disable Egress VLAN tagging
  1409. *
  1410. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1411. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1412. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1413. * @retval IX_ETH_DB_INVALID_VLAN invalid VLAN ID (out of range), or do not constitute a range
  1414. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1415. * @retval IX_ETH_DB_NO_PERMISSION attempted to explicitly remove the default port VLAN ID from the tagging table
  1416. * @retval IX_FAIL unknown OS or NPE communication error
  1417. *
  1418. * @note Specifically removing the default port VLAN ID from the Egress tagging table by setting both vlanIDMin and vlanIDMax
  1419. * to the VLAN ID portion of the PVID is not allowed by this function and will return IX_ETH_DB_NO_PERMISSION.
  1420. * However, this can be circumvented, should the user specifically desire this, by either using a
  1421. * larger range (vlanIDMin < vlanIDMax) or by using ixEthDBEgressVlanEntryTaggingEnabledSet.
  1422. */
  1423. IX_ETH_DB_PUBLIC
  1424. IxEthDBStatus ixEthDBEgressVlanRangeTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax, BOOL enabled);
  1425. /**
  1426. * @ingroup IxEthDB
  1427. *
  1428. * @fn IxEthDBStatus ixEthDBEgressVlanTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
  1429. *
  1430. * @brief Sets the complete Egress VLAN tagging table for a port
  1431. *
  1432. * This function is used to set the VLAN tagging/untagging per VLAN ID for a given port
  1433. * covering the entire VLAN ID range (0..4094). The <i>vlanSet</i> parameter is a 4096
  1434. * bit array, each bit indicating the Egress behavior for the corresponding VLAN ID.
  1435. * If a bit is set then outgoing frames with the corresponding VLAN ID will be transmitted
  1436. * with the VLAN tag, otherwise the frame will be transmitted without the VLAN tag.
  1437. *
  1438. * Bit 0 has a special significance, indicating tagging or tag removal for priority-tagged
  1439. * frames.
  1440. *
  1441. * Bit 4095 is reserved and should never be set (it will be ignored if set).
  1442. *
  1443. * - Reentrant - no
  1444. * - ISR Callable - no
  1445. *
  1446. * @param portID @ref IxEthDBPortId [in] - ID of the port whose Egress VLAN tagging behavior is set
  1447. * @param vlanSet @ref IxEthDBVlanSet [in] - 4096 bit array controlling per-VLAN tagging and untagging
  1448. *
  1449. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1450. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1451. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1452. * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
  1453. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1454. * @retval IX_FAIL unknown OS or NPE communication error
  1455. *
  1456. * @warning This function will automatically add the default port VLAN ID to the Egress tagging table
  1457. * every time it is called. The user should manually call ixEthDBEgressVlanEntryTaggingEnabledSet to
  1458. * prevent tagging on the default port VLAN ID if the default behavior is not intended.
  1459. */
  1460. IX_ETH_DB_PUBLIC
  1461. IxEthDBStatus ixEthDBEgressVlanTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet);
  1462. /**
  1463. * @ingroup IxEthDB
  1464. *
  1465. * @fn IxEthDBStatus ixEthDBEgressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
  1466. *
  1467. * @brief Retrieves the complete Egress VLAN tagging table from a port
  1468. *
  1469. * This function copies the 4096 bit table controlling the Egress VLAN tagging into a user specified
  1470. * area. Each bit in the array indicates whether tagging for the corresponding VLAN (the bit position
  1471. * in the array) is enabled (the bit is set) or not (the bit is unset).
  1472. *
  1473. * Bit 4095 is reserved and should not be set (it will be ignored if set).
  1474. *
  1475. * @see ixEthDBEgressVlanTaggingEnabledSet
  1476. *
  1477. * @param portID @ref IxEthDBPortId [in] - ID of the port whose Egress VLAN tagging behavior is retrieved
  1478. * @param vlanSet @ref IxEthDBVlanSet [out] - user location to copy the Egress tagging table into; should have
  1479. * room to store 4096 bits (512 bytes)
  1480. *
  1481. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1482. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1483. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1484. * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
  1485. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1486. */
  1487. IX_ETH_DB_PUBLIC
  1488. IxEthDBStatus ixEthDBEgressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet);
  1489. /**
  1490. * @ingroup IxEthDB
  1491. *
  1492. * @fn IxEthDBStatus ixEthDBIngressVlanTaggingEnabledSet(IxEthDBPortId portID, IxEthDBTaggingAction taggingAction)
  1493. *
  1494. * @brief Sets the Ingress VLAN tagging behavior for a port
  1495. *
  1496. * A port's Ingress tagging behavior is controlled by the taggingAction parameter,
  1497. * which can take one of the following values:
  1498. *
  1499. * - IX_ETH_DB_PASS_THROUGH - leaves the frame unchanged (does not add or remove the VLAN tag)
  1500. * - IX_ETH_DB_ADD_TAG - adds the VLAN tag if not present, using the default port VID
  1501. * - IX_ETH_DB_REMOVE_TAG - removes the VLAN tag if present
  1502. *
  1503. * @param portID @ref IxEthDBPortId [in] - ID of the port whose Ingress VLAN tagging behavior is set
  1504. * @param taggingAction @ref IxEthDBTaggingAction [in] - tagging behavior for the port
  1505. *
  1506. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1507. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1508. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1509. * @retval IX_ETH_DB_INVALID_ARG invalid <i>taggingAction</i> argument
  1510. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1511. * @retval IX_FAIL unknown OS or NPE communication error
  1512. */
  1513. IX_ETH_DB_PUBLIC
  1514. IxEthDBStatus ixEthDBIngressVlanTaggingEnabledSet(IxEthDBPortId portID, IxEthDBTaggingAction taggingAction);
  1515. /**
  1516. * @ingroup IxEthDB
  1517. *
  1518. * @fn IxEthDBStatus ixEthDBIngressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBTaggingAction *taggingAction)
  1519. *
  1520. * @brief Retrieves the Ingress VLAN tagging behavior from a port (see @ref ixEthDBIngressVlanTaggingEnabledSet)
  1521. *
  1522. * @param portID @ref IxEthDBPortId [in] - ID of the port whose Ingress VLAN tagging behavior is set
  1523. * @param taggingAction @ref IxEthDBTaggingAction [out] - location where the tagging behavior for the port is written to
  1524. *
  1525. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1526. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1527. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1528. * @retval IX_ETH_DB_INVALID_ARG invalid <i>taggingAction</i> pointer argument
  1529. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1530. */
  1531. IX_ETH_DB_PUBLIC
  1532. IxEthDBStatus ixEthDBIngressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBTaggingAction *taggingAction);
  1533. /**
  1534. * @ingroup IxEthDB
  1535. *
  1536. * @fn IxEthDBStatus ixEthDBVlanPortExtractionEnable(IxEthDBPortId portID, BOOL enable)
  1537. *
  1538. * @brief Enables or disables port ID extraction
  1539. *
  1540. * This feature can be used in the situation when a multi-port device (e.g. a switch)
  1541. * is connected to an IXP4xx port and the device can provide incoming frame port
  1542. * identification by tagging the TPID field in the Ethernet frame. Enabling
  1543. * port extraction will instruct the NPE to copy the TPID field from the frame and
  1544. * place it in the <i>ixp_ne_src_port</i> of the <i>ixp_buf</i> header. In addition,
  1545. * the NPE restores the TPID field to 0.
  1546. *
  1547. * If the frame is not tagged the NPE will fill the <i>ixp_ne_src_port</i> with the
  1548. * port ID of the MII interface the frame was received from.
  1549. *
  1550. * The TPID field is the least significant byte of the type/length field, which is
  1551. * normally set to 0x8100 for 802.1Q-tagged frames.
  1552. *
  1553. * This feature is disabled by default.
  1554. *
  1555. * @param portID ID of the port to configure port ID extraction on
  1556. * @param enable TRUE to enable port ID extraction and FALSE to disable it
  1557. *
  1558. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1559. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1560. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1561. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
  1562. * @retval IX_FAIL unknown OS or NPE communication error
  1563. */
  1564. IX_ETH_DB_PUBLIC
  1565. IxEthDBStatus ixEthDBVlanPortExtractionEnable(IxEthDBPortId portID, BOOL enable);
  1566. /**
  1567. * @ingroup IxEthDB
  1568. *
  1569. * @fn IxEthDBStatus ixEthDBFeatureCapabilityGet(IxEthDBPortId portID, IxEthDBFeature *featureSet)
  1570. *
  1571. * @brief Retrieves the feature capability set for a port
  1572. *
  1573. * This function retrieves the feature capability set for a port or the common capabilities shared between all
  1574. * the ports, writing the feature capability set in a user specified location.
  1575. *
  1576. * The feature capability set will consist of a set formed by OR-ing one or more of the following values:
  1577. * - IX_ETH_DB_LEARNING - Learning feature; enables EthDB to learn MAC address (filtering) records, including 802.1Q enabled records
  1578. * - IX_ETH_DB_FILTERING - Filtering feature; enables EthDB to communicate with the NPEs for downloading filtering information in the NPEs; depends on the learning feature
  1579. * - IX_ETH_DB_VLAN_QOS - VLAN/QoS feature; enables EthDB to configure NPEs to operate in VLAN/QoS aware modes
  1580. * - IX_ETH_DB_FIREWALL - Firewall feature; enables EthDB to configure NPEs to operate in firewall mode, using white/black address lists
  1581. * - IX_ETH_DB_SPANNING_TREE_PROTOCOL - Spanning tree protocol feature; enables EthDB to configure the NPEs as STP nodes
  1582. * - IX_ETH_DB_WIFI_HEADER_CONVERSION - WiFi 802.3 to 802.11 header conversion feature; enables EthDB to handle WiFi conversion data
  1583. *
  1584. * Note that EthDB provides only the LEARNING feature for non-NPE ports.
  1585. *
  1586. * @param portID @ref IxEthDBPortId [in] - ID of the port to retrieve the capability set for
  1587. * (use IX_ETH_DB_ALL_PORTS to retrieve the common capabilities shared between all the ports)
  1588. * @param featureSet @ref IxEthDBFeature [out] - location where the capability set will be written to
  1589. *
  1590. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1591. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1592. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1593. * @retval IX_ETH_DB_INVALID_ARG invalid <i>featureSet</i> pointer
  1594. */
  1595. IX_ETH_DB_PUBLIC
  1596. IxEthDBStatus ixEthDBFeatureCapabilityGet(IxEthDBPortId portID, IxEthDBFeature *featureSet);
  1597. /**
  1598. * @ingroup IxEthDB
  1599. *
  1600. * @fn IxEthDBStatus ixEthDBFeatureEnable(IxEthDBPortId portID, IxEthDBFeature feature, BOOL enabled)
  1601. *
  1602. * @brief Enables or disables one or more EthDB features
  1603. *
  1604. * Selects one or more features (see @ref ixEthDBFeatureCapabilityGet for a description of the supported
  1605. * features) to be enabled or disabled on the selected port (or all the ports).
  1606. *
  1607. * Note that some features are mutually incompatible:
  1608. * - IX_ETH_DB_FILTERING is incompatible with IX_ETH_DB_WIFI_HEADER_CONVERSION
  1609. *
  1610. * Also note that some features require other features to be enabled:
  1611. * - IX_ETH_DB_FILTERING requires IX_ETH_DB_LEARNING
  1612. *
  1613. * This function will either enable the entire selected feature set for the selected port (or all the ports),
  1614. * in which case it will return IX_ETH_DB_SUCCESS, or in case of error it will not enable any feature at all
  1615. * and return an appropriate error message.
  1616. *
  1617. * The following features are enabled by default (for ports with the respective capability),
  1618. * for compatibility reasons with previous versions of CSR:
  1619. * - IX_ETH_DB_LEARNING
  1620. * - IX_ETH_DB_FILTERING
  1621. *
  1622. * All other features are disabled by default and require manual enabling using ixEthDBFeatureEnable.
  1623. *
  1624. * <b>Default settings for VLAN, QoS, Firewall and WiFi header conversion features:</b>
  1625. *
  1626. * <i>VLAN</i>
  1627. *
  1628. * When the VLAN/QoS feature is enabled for a port for the first time the default VLAN behavior
  1629. * of the port is set to be as <b>permissive</b> (it will accept all the frames) and
  1630. * <b>non-interferential</b> (it will not change any frames) as possible:
  1631. * - the port VLAN ID (VID) is set to 0
  1632. * - the Ingress acceptable frame filter is set to accept all frames
  1633. * - the VLAN port membership is set to the complete VLAN range (0 - 4094)
  1634. * - the Ingress tagging mode is set to pass-through (will not change frames)
  1635. * - the Egress tagging mode is to send tagged frames in the entire VLAN range (0 - 4094)
  1636. *
  1637. * Note that further disabling and re-enabling the VLAN feature for a given port will not reset the port VLAN behavior
  1638. * to the settings listed above. Any VLAN settings made by the user are kept.
  1639. *
  1640. * <i>QoS</i>
  1641. *
  1642. * The following default priority mapping table will be used (as per IEEE 802.1Q and IEEE 802.1D):
  1643. *
  1644. * <table border="1"> <caption> QoS traffic classes </caption>
  1645. * <tr> <td> <b> QoS priority <td> <b> Default traffic class <td> <b> Traffic type </b>
  1646. * <tr> <td> 0 <td> 1 <td> Best effort, default class for unexpedited traffic
  1647. * <tr> <td> 1 <td> 0 <td> Background traffic
  1648. * <tr> <td> 2 <td> 0 <td> Spare bandwidth
  1649. * <tr> <td> 3 <td> 1 <td> Excellent effort
  1650. * <tr> <td> 4 <td> 2 <td> Controlled load
  1651. * <tr> <td> 5 <td> 2 <td> Video traffic
  1652. * <tr> <td> 6 <td> 3 <td> Voice traffic
  1653. * <tr> <td> 7 <td> 3 <td> Network control
  1654. * </table>
  1655. *
  1656. * <i> Firewall </i>
  1657. *
  1658. * The port firewall is configured by default in <b>black-list mode</b>, and the firewall address table is empty.
  1659. * This means the firewall will not filter any frames until the feature is configured and the firewall table is
  1660. * downloaded to the NPE.
  1661. *
  1662. * <i> Spanning Tree </i>
  1663. *
  1664. * The port is set to <b>STP unblocked mode</b>, therefore it will accept all frames until re-configured.
  1665. *
  1666. * <i> WiFi header conversion </i>
  1667. *
  1668. * The WiFi header conversion database is empty, therefore no actual header conversion will take place until this
  1669. * feature is configured and the conversion table downloaded to the NPE.
  1670. *
  1671. * @param portID @ref IxEthDBPortId [in] - ID of the port to enable or disable the features on (use IX_ETH_DB_ALL_PORTS for all the ports)
  1672. * @param feature @ref IxEthDBFeature [in] - feature or feature set to enable or disable
  1673. * @param enabled BOOL [in] - TRUE to enable the feature and FALSE to disable it
  1674. *
  1675. * @note Certain features, from a functional point of view, cannot be disabled as such at NPE level;
  1676. * when such features are set to <i>disabled</i> using the EthDB API they will be configured in such
  1677. * a way to determine a behavior equivalent to the feature being disabled. As well as this, disabled
  1678. * features cannot be configured or accessed via the EthDB API (except for getting their status).
  1679. *
  1680. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1681. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1682. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1683. * @retval IX_ETH_DB_NO_PERMISSION attempted to enable mutually exclusive features,
  1684. * or a feature that depends on another feature which is not present or enabled
  1685. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE at least one of the features selected is unavailable
  1686. * @retval IX_FAIL unknown OS or NPE communication error
  1687. */
  1688. IX_ETH_DB_PUBLIC
  1689. IxEthDBStatus ixEthDBFeatureEnable(IxEthDBPortId portID, IxEthDBFeature feature, BOOL enabled);
  1690. /**
  1691. * @ingroup IxEthDB
  1692. *
  1693. * @fn IxEthDBStatus ixEthDBFeatureStatusGet(IxEthDBPortId portID, IxEthDBFeature feature, BOOL *present, BOOL *enabled)
  1694. *
  1695. * @brief Retrieves the availability and status of a feature set
  1696. *
  1697. * This function returns the availability and status for a feature set.
  1698. * Note that if more than one feature is selected (e.g. IX_ETH_DB_LEARNING | IX_ETH_DB_FILTERING)
  1699. * the "present" and "enabled" return values will be set to TRUE only if all the features in the
  1700. * feature set are present and enabled (not only some).
  1701. *
  1702. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1703. * @param feature @ref IxEthDBFeature [in] - identifier of the feature to retrieve the status for
  1704. * @param present BOOL [out] - location where a boolean flag indicating whether this feature is present will be written to
  1705. * @param enabled BOOL [out] - location where a boolean flag indicating whether this feature is enabled will be written to
  1706. *
  1707. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1708. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1709. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1710. * @retval IX_ETH_DB_INVALID_ARG either <i>present</i> or <i>enabled</i> pointer argument is invalid
  1711. */
  1712. IX_ETH_DB_PUBLIC
  1713. IxEthDBStatus ixEthDBFeatureStatusGet(IxEthDBPortId portID, IxEthDBFeature feature, BOOL *present, BOOL *enabled);
  1714. /**
  1715. * @ingroup IxEthDB
  1716. *
  1717. * @fn IxEthDBStatus ixEthDBFeaturePropertyGet(IxEthDBPortId portID, IxEthDBFeature feature, IxEthDBProperty property, IxEthDBPropertyType *type, void *value)
  1718. *
  1719. * @brief Retrieves the value of a feature property
  1720. *
  1721. * The EthDB features usually contain feature-specific properties describing or
  1722. * controlling how the feature operates. While essential properties (e.g. the
  1723. * firewall operating mode) have their own API, secondary properties can be
  1724. * retrieved using this function.
  1725. *
  1726. * Properties can be read-only or read-write. ixEthDBFeaturePropertyGet operates with
  1727. * both types of features.
  1728. *
  1729. * Properties have types associated with them. A descriptor indicating the property
  1730. * type is returned in the <i>type</i> argument for convenience.
  1731. *
  1732. * The currently supported properties and their corresponding features are as follows:
  1733. *
  1734. * <table border="1"> <caption> Properties for IX_ETH_DB_VLAN_QOS </caption>
  1735. * <tr> <td> <b> Property identifier <td> <b> Property type <td> <b> Property value <td> <b> Read-Only </b>
  1736. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_COUNT_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> number of internal traffic classes <td> Yes
  1737. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_0_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 0 <td> Yes
  1738. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_1_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 1 <td> Yes
  1739. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_2_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 2 <td> Yes
  1740. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_3_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 3 <td> Yes
  1741. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_4_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 4 <td> Yes
  1742. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_5_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 5 <td> Yes
  1743. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_6_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 6 <td> Yes
  1744. * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_7_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 7 <td> Yes
  1745. * </table>
  1746. *
  1747. * @see ixEthDBFeaturePropertySet
  1748. *
  1749. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1750. * @param feature @ref IxEthDBFeature [in] - EthDB feature for which the property is retrieved
  1751. * @param property @ref IxEthDBProperty [in] - property identifier
  1752. * @param type @ref IxEthDBPropertyType [out] - location where the property type will be stored
  1753. * @param value void [out] - location where the property value will be stored
  1754. *
  1755. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1756. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1757. * @retval IX_ETH_DB_INVALID_ARG invalid property identifier, <i>type</i> or <i>value</i> pointer arguments
  1758. * @retval IX_ETH_DB_FAIL incorrect property value or unknown error
  1759. */
  1760. IX_ETH_DB_PUBLIC
  1761. IxEthDBStatus ixEthDBFeaturePropertyGet(IxEthDBPortId portID, IxEthDBFeature feature, IxEthDBProperty property, IxEthDBPropertyType *type, void *value);
  1762. /**
  1763. * @ingroup IxEthDB
  1764. *
  1765. * @fn IxEthDBStatus ixEthDBFeaturePropertySet(IxEthDBPortId portID, IxEthDBFeature feature, IxEthDBProperty property, void *value)
  1766. *
  1767. * @brief Sets the value of a feature property
  1768. *
  1769. * Unlike @ref ixEthDBFeaturePropertyGet, this function operates only with read-write properties
  1770. *
  1771. * The currently supported properties and their corresponding features are as follows:
  1772. *
  1773. * - IX_ETH_DB_QOS_QUEUE_CONFIGURATION_COMPLETE (for IX_ETH_DB_VLAN_QOS): freezes the availability of traffic classes
  1774. * to the number of traffic classes currently in use
  1775. *
  1776. * Note that this function creates deep copies of the property values; once the function is invoked the client
  1777. * can free or reuse the memory area containing the original property value.
  1778. *
  1779. * Copy behavior for different property types is defined as follows:
  1780. *
  1781. * - IX_ETH_DB_INTEGER_PROPERTY - 4 bytes are copied from the source location
  1782. * - IX_ETH_DB_STRING_PROPERTY - the source string will be copied up to the NULL '\0' string terminator, maximum of 255 characters
  1783. * - IX_ETH_DB_MAC_ADDR_PROPERTY - 6 bytes are copied from the source location
  1784. * - IX_ETH_DB_BOOL_PROPERTY - 4 bytes are copied from the source location; the only allowed values are TRUE (1L) and false (0L)
  1785. *
  1786. * @see ixEthDBFeaturePropertySet
  1787. *
  1788. * @warning IX_ETH_DB_QOS_QUEUE_CONFIGURATION_COMPLETE is provided for EthAcc internal use;
  1789. * do not attempt to set this property directly
  1790. *
  1791. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1792. * @param feature @ref IxEthDBFeature [in] - EthDB feature for which the property is set
  1793. * @param property @ref IxEthDBProperty [in] - property identifier
  1794. * @param value void [in] - location where the property value is to be copied from
  1795. *
  1796. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1797. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1798. * @retval IX_ETH_DB_INVALID_ARG invalid property identifier, <i>value</i> pointer, or invalid property value
  1799. */
  1800. IX_ETH_DB_PUBLIC
  1801. IxEthDBStatus ixEthDBFeaturePropertySet(IxEthDBPortId portID, IxEthDBFeature feature, IxEthDBProperty property, void *value);
  1802. /**
  1803. * @ingroup IxEthDB
  1804. *
  1805. * @fn IxEthDBStatus ixEthDBDatabaseClear(IxEthDBPortId portID, IxEthDBRecordType recordType)
  1806. *
  1807. * @brief Deletes a set of record types from the Ethernet Database
  1808. *
  1809. * This function deletes all the records of certain types (specified in the recordType filter)
  1810. * associated with a port. Additionally, the IX_ETH_DB_ALL_PORTS value can be used as port ID
  1811. * to indicate that the specified record types should be deleted for all the ports.
  1812. *
  1813. * The record type filter can be an ORed combination of the following types:
  1814. *
  1815. * <caption> Record types </caption>
  1816. * - IX_ETH_DB_FILTERING_RECORD <table><caption> Filtering record </caption>
  1817. * <tr><td> MAC address <td> static/dynamic type <td> age </tr>
  1818. * </table>
  1819. *
  1820. * - IX_ETH_DB_FILTERING_VLAN_RECORD <table><caption> VLAN-enabled filtering record </caption>
  1821. * <tr><td> MAC address <td> static/dynamic type <td> age <td> 802.1Q tag </tr>
  1822. * </table>
  1823. *
  1824. * - IX_ETH_DB_WIFI_RECORD <table><caption> WiFi header conversion record </caption>
  1825. * <tr><td> MAC address <td> optional gateway MAC address <td> </tr>
  1826. * </table>
  1827. *
  1828. * - IX_ETH_DB_FIREWALL_RECORD <table><caption> Firewall record </caption>
  1829. * <tr><td> MAC address </tr>
  1830. * </table>
  1831. * - IX_ETH_DB_ALL_RECORD_TYPES
  1832. *
  1833. * Any combination of the above types is valid e.g.
  1834. *
  1835. * (IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_FILTERING_VLAN_RECORD | IX_ETH_DB_FIREWALL_RECORD),
  1836. *
  1837. * although some might be redundant (it is not an error to do so) e.g.
  1838. *
  1839. * (IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_ALL_RECORD_TYPES)
  1840. *
  1841. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1842. * @param recordType @ref IxEthDBRecordType [in] - record type filter
  1843. *
  1844. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1845. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1846. * @retval IX_ETH_DB_INVALID_ARG invalid <i>recordType</i> filter
  1847. *
  1848. * @note If the record type filter contains any unrecognized value (hence the
  1849. * IX_ETH_DB_INVALID_ARG error value is returned) no actual records will be deleted.
  1850. */
  1851. IX_ETH_DB_PUBLIC
  1852. IxEthDBStatus ixEthDBDatabaseClear(IxEthDBPortId portID, IxEthDBRecordType recordType);
  1853. /**
  1854. * @ingroup IxEthDB
  1855. *
  1856. * @fn IxEthDBStatus ixEthDBWiFiStationEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  1857. *
  1858. * @brief Adds an "Access Point to Station" record to the database, for 802.3 => 802.11 frame
  1859. * header conversion
  1860. *
  1861. * Frame header conversion is controlled by the set of MAC addresses
  1862. * added using @ref ixEthDBWiFiStationEntryAdd and @ref ixEthDBWiFiAccessPointEntryAdd.
  1863. * Conversion arguments are added using @ref ixEthDBWiFiFrameControlSet,
  1864. * @ref ixEthDBWiFiDurationIDSet and @ref ixEthDBWiFiBBSIDSet.
  1865. *
  1866. * Note that adding the same MAC address twice will not return an error
  1867. * (but will not accomplish anything either), while re-adding a record previously added
  1868. * as an "Access Point to Access Point" will migrate the record to the "Access Point
  1869. * to Station" type.
  1870. *
  1871. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1872. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to add
  1873. *
  1874. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1875. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1876. * @retval IX_ETH_DB_INVALID_ARG macAddr is an invalid pointer
  1877. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  1878. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  1879. * @retval IX_ETH_DB_NOMEM maximum number of records reached
  1880. * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
  1881. */
  1882. IX_ETH_DB_PUBLIC
  1883. IxEthDBStatus ixEthDBWiFiStationEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  1884. /**
  1885. * @ingroup IxEthDB
  1886. *
  1887. * @fn IxEthDBStatus ixEthDBWiFiAccessPointEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr, IxEthDBMacAddr *gatewayMacAddr)
  1888. *
  1889. * @brief Adds an "Access Point to Access Point" record to the database
  1890. *
  1891. * @see ixEthDBWiFiStationEntryAdd
  1892. *
  1893. * Note that adding the same MAC address twice will simply overwrite the previously
  1894. * defined gateway MAC address value in the same record, if the record was previously of the
  1895. * "Access Point to Access Point" type.
  1896. *
  1897. * Re-adding a MAC address as "Access Point to Access Point", which was previously added as
  1898. * "Access Point to Station" will migrate the record type to "Access Point to Access Point" and
  1899. * record the gateway MAC address.
  1900. *
  1901. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1902. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to add
  1903. * @param gatewayMacAddr @ref IxEthDBMacAddr [in] - MAC address of the gateway Access Point
  1904. *
  1905. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1906. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1907. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1908. * @retval IX_ETH_DB_INVALID_ARG macAddr is an invalid pointer
  1909. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  1910. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> or <i>gatewayMacAddr</i> pointer argument
  1911. * @retval IX_ETH_DB_NOMEM maximum number of records reached
  1912. * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
  1913. */
  1914. IX_ETH_DB_PUBLIC
  1915. IxEthDBStatus ixEthDBWiFiAccessPointEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr, IxEthDBMacAddr *gatewayMacAddr);
  1916. /**
  1917. * @ingroup IxEthDB
  1918. *
  1919. * @fn IxEthDBStatus ixEthDBWiFiEntryRemove(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  1920. *
  1921. * @brief Removes a WiFi station record
  1922. *
  1923. * This function removes both types of WiFi records ("Access Point to Station" and
  1924. * "Access Point to Access Point").
  1925. *
  1926. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1927. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to remove
  1928. *
  1929. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1930. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1931. * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
  1932. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  1933. * @retval IX_ETH_DB_NO_SUCH_ADDR specified address was not found in the database
  1934. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  1935. * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
  1936. */
  1937. IX_ETH_DB_PUBLIC
  1938. IxEthDBStatus ixEthDBWiFiEntryRemove(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  1939. /**
  1940. * @ingroup IxEthDB
  1941. *
  1942. * @fn IxEthDBStatus ixEthDBWiFiConversionTableDownload(IxEthDBPortId portID)
  1943. *
  1944. * @brief Downloads the MAC address table for 802.3 => 802.11 frame header
  1945. * conversion to the NPE
  1946. *
  1947. * Note that the frame conversion MAC address table must be individually downloaded
  1948. * to each NPE for which the frame header conversion feature is enabled (i.e. it
  1949. * is not possible to specify IX_ETH_DB_ALL_PORTS).
  1950. *
  1951. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1952. *
  1953. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1954. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  1955. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1956. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  1957. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  1958. */
  1959. IX_ETH_DB_PUBLIC
  1960. IxEthDBStatus ixEthDBWiFiConversionTableDownload(IxEthDBPortId portID);
  1961. /**
  1962. * @ingroup IxEthDB
  1963. *
  1964. * @fn IxEthDBStatus ixEthDBWiFiFrameControlSet(IxEthDBPortId portID, UINT16 frameControl)
  1965. *
  1966. * @brief Sets the GlobalFrameControl field
  1967. *
  1968. * The GlobalFrameControl field is a 2-byte value inserted in the <i>Frame Control</i>
  1969. * field for all 802.3 to 802.11 frame header conversions
  1970. *
  1971. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1972. * @param frameControl UINT16 [in] - GlobalFrameControl value
  1973. *
  1974. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1975. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1976. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  1977. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  1978. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  1979. */
  1980. IX_ETH_DB_PUBLIC
  1981. IxEthDBStatus ixEthDBWiFiFrameControlSet(IxEthDBPortId portID, UINT16 frameControl);
  1982. /**
  1983. * @ingroup IxEthDB
  1984. *
  1985. * @fn IxEthDBStatus ixEthDBWiFiDurationIDSet(IxEthDBPortId portID, UINT16 durationID)
  1986. *
  1987. * @brief Sets the GlobalDurationID field
  1988. *
  1989. * The GlobalDurationID field is a 2-byte value inserted in the <i>Duration/ID</i>
  1990. * field for all 802.3 to 802.11 frame header conversions
  1991. *
  1992. * @param portID @ref IxEthDBPortId [in] - ID of the port
  1993. * @param durationID UINT16 [in] - GlobalDurationID field
  1994. *
  1995. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  1996. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  1997. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  1998. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  1999. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  2000. */
  2001. IX_ETH_DB_PUBLIC
  2002. IxEthDBStatus ixEthDBWiFiDurationIDSet(IxEthDBPortId portID, UINT16 durationID);
  2003. /**
  2004. * @ingroup IxEthDB
  2005. *
  2006. * @fn IxEthDBStatus ixEthDBWiFiBBSIDSet(IxEthDBPortId portID, IxEthDBMacAddr *bbsid)
  2007. *
  2008. * @brief Sets the BBSID field
  2009. *
  2010. * The BBSID field is a 6-byte value which
  2011. * identifies the infrastructure of the service set managed
  2012. * by the Access Point having the IXP400 as its processor. The value
  2013. * is written in the <i>BBSID</i> field of the 802.11 frame header.
  2014. * The BBSID value is the MAC address of the Access Point.
  2015. *
  2016. * @param portID @ref IxEthDBPortId [in] - ID of the port
  2017. * @param bbsid @ref IxEthDBMacAddr [in] - pointer to 6 bytes containing the BSSID
  2018. *
  2019. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2020. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2021. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2022. * @retval IX_ETH_DB_INVALID_ARG invalid <i>bbsid</i> pointer argument
  2023. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
  2024. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  2025. */
  2026. IX_ETH_DB_PUBLIC
  2027. IxEthDBStatus ixEthDBWiFiBBSIDSet(IxEthDBPortId portID, IxEthDBMacAddr *bbsid);
  2028. /**
  2029. * @ingroup IxEthDB
  2030. *
  2031. * @fn IxEthDBStatus ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID, BOOL blocked)
  2032. *
  2033. * @brief Sets the STP blocked/unblocked state for a port
  2034. *
  2035. * @param portID @ref IxEthDBPortId [in] - ID of the port
  2036. * @param blocked BOOL [in] - TRUE to set the port as STP blocked, FALSE to set it as unblocked
  2037. *
  2038. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2039. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2040. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2041. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Spanning Tree Protocol feature not enabled
  2042. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  2043. */
  2044. IX_ETH_DB_PUBLIC
  2045. IxEthDBStatus ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID, BOOL blocked);
  2046. /**
  2047. * @ingroup IxEthDB
  2048. *
  2049. * @fn IxEthDBStatus ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID, BOOL *blocked)
  2050. *
  2051. * @brief Retrieves the STP blocked/unblocked state for a port
  2052. *
  2053. * @param portID @ref IxEthDBPortId [in] - ID of the port
  2054. * @param blocked BOOL * [in] - set to TRUE if the port is STP blocked, FALSE otherwise
  2055. *
  2056. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2057. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2058. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2059. * @retval IX_ETH_DB_INVALID_ARG invalid <i>blocked</i> pointer argument
  2060. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Spanning Tree Protocol feature not enabled
  2061. */
  2062. IX_ETH_DB_PUBLIC
  2063. IxEthDBStatus ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID, BOOL *blocked);
  2064. /**
  2065. * @ingroup IxEthDB
  2066. *
  2067. * @fn IxEthDBStatus ixEthDBFirewallModeSet(IxEthDBPortId portID, IxEthDBFirewallMode mode)
  2068. *
  2069. * @brief Sets the firewall mode to use white or black listing
  2070. *
  2071. * When enabled, the NPE MAC address based firewall support operates in two modes:
  2072. *
  2073. * - white-list mode (MAC address based admission)
  2074. * - <i>mode</i> set to IX_ETH_DB_FIREWALL_WHITE_LIST
  2075. * - only packets originating from MAC addresses contained in the firewall address list
  2076. * are allowed on the Rx path
  2077. * - black-list mode (MAC address based blocking)
  2078. * - <i>mode</i> set to IX_ETH_DB_FIREWALL_BLACK_LIST
  2079. * - packets originating from MAC addresses contained in the firewall address list
  2080. * are discarded
  2081. *
  2082. * @param portID @ref IxEthDBPortId [in] - ID of the port
  2083. * @param mode @ref IxEthDBFirewallMode [in] - firewall mode (IX_ETH_DB_FIREWALL_WHITE_LIST or IX_ETH_DB_FIREWALL_BLACK_LIST)
  2084. *
  2085. * @note by default the firewall operates in black-list mode with an empty address
  2086. * list, hence it doesn't filter any packets
  2087. *
  2088. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2089. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2090. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2091. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
  2092. * @retval IX_ETH_DB_INVALID_ARGUMENT <i>mode</i> argument is not a valid firewall configuration mode
  2093. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  2094. */
  2095. IX_ETH_DB_PUBLIC
  2096. IxEthDBStatus ixEthDBFirewallModeSet(IxEthDBPortId portID, IxEthDBFirewallMode mode);
  2097. /**
  2098. * @ingroup IxEthDB
  2099. *
  2100. * @fn ixEthDBFirewallInvalidAddressFilterEnable(IxEthDBPortId portID, BOOL enable)
  2101. *
  2102. * @brief Enables or disables invalid MAC address filtering
  2103. *
  2104. * According to IEEE802 it is illegal for a source address to be a multicast
  2105. * or broadcast address. If this feature is enabled the NPE inspects the source
  2106. * MAC addresses of incoming frames and discards them if invalid addresses are
  2107. * detected.
  2108. *
  2109. * By default this service is enabled, if the firewall feature is supported by the
  2110. * NPE image.
  2111. *
  2112. * @param portID ID of the port
  2113. * @param enable TRUE to enable invalid MAC address filtering and FALSE to disable it
  2114. *
  2115. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2116. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2117. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2118. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
  2119. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  2120. */
  2121. IX_ETH_DB_PUBLIC
  2122. IxEthDBStatus ixEthDBFirewallInvalidAddressFilterEnable(IxEthDBPortId portID, BOOL enable);
  2123. /**
  2124. * @ingroup IxEthDB
  2125. *
  2126. * @fn IxEthDBStatus ixEthDBFirewallEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  2127. *
  2128. * @brief Adds a MAC address to the firewall address list
  2129. *
  2130. * Note that adding the same MAC address twice will not return an error
  2131. * but will not actually accomplish anything.
  2132. *
  2133. * The firewall MAC address list has a limited number of entries; once
  2134. * the maximum number of entries has been reached this function will failed
  2135. * to add more addresses, returning IX_ETH_DB_NOMEM.
  2136. *
  2137. * @param portID @ref IxEthDBPortId [in] - ID of the port
  2138. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to be added
  2139. *
  2140. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2141. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2142. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2143. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  2144. * @retval IX_ETH_DB_NOMEM maximum number of records reached
  2145. * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
  2146. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
  2147. */
  2148. IX_ETH_DB_PUBLIC
  2149. IxEthDBStatus ixEthDBFirewallEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  2150. /**
  2151. * @ingroup IxEthDB
  2152. *
  2153. * @fn IxEthDBStatus ixEthDBFirewallEntryRemove(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
  2154. *
  2155. * @brief Removes a MAC address from the firewall address list
  2156. *
  2157. * @param portID @ref IxEthDBPortId [in] - ID of the port
  2158. * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to be removed
  2159. *
  2160. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2161. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2162. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2163. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  2164. * @retval IX_ETH_DB_NO_SUCH_ADDR address not found
  2165. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
  2166. */
  2167. IX_ETH_DB_PUBLIC
  2168. IxEthDBStatus ixEthDBFirewallEntryRemove(IxEthDBPortId portID, IxEthDBMacAddr *macAddr);
  2169. /**
  2170. * @ingroup IxEthDB
  2171. *
  2172. * @fn IxEthDBStatus ixEthDBFirewallTableDownload(IxEthDBPortId portID)
  2173. *
  2174. * @brief Downloads the MAC firewall table to a port
  2175. *
  2176. * @param portID ID of the port
  2177. *
  2178. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2179. * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
  2180. * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
  2181. * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
  2182. * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
  2183. */
  2184. IX_ETH_DB_PUBLIC
  2185. IxEthDBStatus ixEthDBFirewallTableDownload(IxEthDBPortId portID);
  2186. /**
  2187. * @ingroup IxEthDB
  2188. *
  2189. * @fn IxEthDBStatus ixEthDBUserFieldSet(IxEthDBRecordType recordType, IxEthDBMacAddr *macAddr, IxEthDBPortId portID, IxEthDBVlanId vlanID, void *field)
  2190. *
  2191. * @brief Adds a user-defined field to a database record
  2192. *
  2193. * This function associates a user-defined field to a database record.
  2194. * The user-defined field is passed as a <i>(void *)</i> parameter, hence it can be used
  2195. * for any purpose (such as identifying a structure). Retrieving the user-defined field from
  2196. * a record is done using @ref ixEthDBUserFieldGet. Note that EthDB never uses the user-defined
  2197. * field for any internal operation and it is not aware of the significance of its contents. The
  2198. * field is only stored as a pointer.
  2199. *
  2200. * The database record is identified using a combination of the given parameters, depending on the record type.
  2201. * All the record types require the record MAC address.
  2202. *
  2203. * - IX_ETH_DB_FILTERING_RECORD requires only the MAC address
  2204. * - IX_ETH_DB_VLAN_FILTERING_RECORD requires the MAC address and the VLAN ID
  2205. * - IX_ETH_DB_WIFI_RECORD requires the MAC address and the portID
  2206. * - IX_ETH_DB_FIREWALL_RECORD requires the MAC address and the portID
  2207. *
  2208. * Please note that if a parameter is not required it is completely ignored (it does not undergo parameter checking).
  2209. * The user-defined field can be cleared using a <b>NULL</b> <i>field</i> parameter.
  2210. *
  2211. * @param recordType @ref IxEthDBRecordType [in] - type of record (can be IX_ETH_DB_FILTERING_RECORD,
  2212. * IX_ETH_DB_FILTERING_VLAN_RECORD, IX_ETH_DB_WIFI_RECORD or IX_ETH_DB_FIREWALL_RECORD)
  2213. * @param portID @ref IxEthDBPortId [in] - ID of the port (required only for WIFI and FIREWALL records)
  2214. * @param macAddr @ref IxEthDBMacAddr * [in] - MAC address of the record
  2215. * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID of the record (required only for FILTERING_VLAN records)
  2216. * @param field void * [in] - user defined field
  2217. *
  2218. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2219. * @retval IX_ETH_DB_INVALID_PORT portID was required but it is not a valid port identifier
  2220. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
  2221. * @retval IX_ETH_DB_NO_SUCH_ADDR record not found
  2222. */
  2223. IX_ETH_DB_PUBLIC
  2224. IxEthDBStatus ixEthDBUserFieldSet(IxEthDBRecordType recordType, IxEthDBMacAddr *macAddr, IxEthDBPortId portID, IxEthDBVlanId vlanID, void *field);
  2225. /**
  2226. * @ingroup IxEthDB
  2227. *
  2228. * @fn IxEthDBStatus ixEthDBUserFieldGet(IxEthDBRecordType recordType, IxEthDBMacAddr *macAddr, IxEthDBPortId portID, IxEthDBVlanId vlanID, void **field)
  2229. *
  2230. * @brief Retrieves a user-defined field from a database record
  2231. *
  2232. * The database record is identified using a combination of the given parameters, depending on the record type.
  2233. * All the record types require the record MAC address.
  2234. *
  2235. * - IX_ETH_DB_FILTERING_RECORD requires only the MAC address
  2236. * - IX_ETH_DB_VLAN_FILTERING_RECORD requires the MAC address and the VLAN ID
  2237. * - IX_ETH_DB_WIFI_RECORD requires the MAC address and the portID
  2238. * - IX_ETH_DB_FIREWALL_RECORD requires the MAC address and the portID
  2239. *
  2240. * Please note that if a parameter is not required it is completely ignored (it does not undergo parameter checking).
  2241. *
  2242. * If no user-defined field was registered with the specified record then <b>NULL</b> will be written
  2243. * at the location specified by <i>field</i>.
  2244. *
  2245. * @param recordType type of record (can be IX_ETH_DB_FILTERING_RECORD, IX_ETH_DB_FILTERING_VLAN_RECORD, IX_ETH_DB_WIFI_RECORD
  2246. * or IX_ETH_DB_FIREWALL_RECORD)
  2247. * @param portID ID of the port (required only for WIFI and FIREWALL records)
  2248. * @param macAddr MAC address of the record
  2249. * @param vlanID VLAN ID of the record (required only for FILTERING_VLAN records)
  2250. * @param field location to write the user defined field into
  2251. *
  2252. * @retval IX_ETH_DB_SUCCESS operation completed successfully
  2253. * @retval IX_ETH_DB_INVALID_PORT portID was required but it is not a valid port identifier
  2254. * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> or <i>field</i> pointer arguments
  2255. * @retval IX_ETH_DB_NO_SUCH_ADDR record not found
  2256. */
  2257. IX_ETH_DB_PUBLIC
  2258. IxEthDBStatus ixEthDBUserFieldGet(IxEthDBRecordType recordType, IxEthDBMacAddr *macAddr, IxEthDBPortId portId, IxEthDBVlanId vlanID, void **field);
  2259. /**
  2260. * @}
  2261. */
  2262. #endif /* IxEthDB_H */