memtypes.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. /*
  2. * Memory type definitions. This file is parsed by memtypes.awk to extract
  3. * MTYPE_ and memory_list_.. information in order to autogenerate
  4. * memtypes.h.
  5. *
  6. * The script is sensitive to the format (though not whitespace), see
  7. * the top of memtypes.awk for more details.
  8. */
  9. #include "zebra.h"
  10. #include "memory.h"
  11. struct memory_list memory_list_lib[] =
  12. {
  13. { MTYPE_TMP, "Temporary memory" },
  14. { MTYPE_STRVEC, "String vector" },
  15. { MTYPE_VECTOR, "Vector" },
  16. { MTYPE_VECTOR_INDEX, "Vector index" },
  17. { MTYPE_LINK_LIST, "Link List" },
  18. { MTYPE_LINK_NODE, "Link Node" },
  19. { MTYPE_THREAD, "Thread" },
  20. { MTYPE_THREAD_MASTER, "Thread master" },
  21. { MTYPE_THREAD_STATS, "Thread stats" },
  22. { MTYPE_VTY, "VTY" },
  23. { MTYPE_VTY_OUT_BUF, "VTY output buffer" },
  24. { MTYPE_VTY_HIST, "VTY history" },
  25. { MTYPE_IF, "Interface" },
  26. { MTYPE_CONNECTED, "Connected" },
  27. { MTYPE_CONNECTED_LABEL, "Connected interface label" },
  28. { MTYPE_BUFFER, "Buffer" },
  29. { MTYPE_BUFFER_DATA, "Buffer data" },
  30. { MTYPE_STREAM, "Stream" },
  31. { MTYPE_STREAM_DATA, "Stream data" },
  32. { MTYPE_STREAM_FIFO, "Stream FIFO" },
  33. { MTYPE_PREFIX, "Prefix" },
  34. { MTYPE_PREFIX_IPV4, "Prefix IPv4" },
  35. { MTYPE_PREFIX_IPV6, "Prefix IPv6" },
  36. { MTYPE_HASH, "Hash" },
  37. { MTYPE_HASH_BACKET, "Hash Bucket" },
  38. { MTYPE_HASH_INDEX, "Hash Index" },
  39. { MTYPE_ROUTE_TABLE, "Route table" },
  40. { MTYPE_ROUTE_NODE, "Route node" },
  41. { MTYPE_DISTRIBUTE, "Distribute list" },
  42. { MTYPE_DISTRIBUTE_IFNAME, "Dist-list ifname" },
  43. { MTYPE_ACCESS_LIST, "Access List" },
  44. { MTYPE_ACCESS_LIST_STR, "Access List Str" },
  45. { MTYPE_ACCESS_FILTER, "Access Filter" },
  46. { MTYPE_PREFIX_LIST, "Prefix List" },
  47. { MTYPE_PREFIX_LIST_ENTRY, "Prefix List Entry" },
  48. { MTYPE_PREFIX_LIST_STR, "Prefix List Str" },
  49. { MTYPE_ROUTE_MAP, "Route map" },
  50. { MTYPE_ROUTE_MAP_NAME, "Route map name" },
  51. { MTYPE_ROUTE_MAP_INDEX, "Route map index" },
  52. { MTYPE_ROUTE_MAP_RULE, "Route map rule" },
  53. { MTYPE_ROUTE_MAP_RULE_STR, "Route map rule str" },
  54. { MTYPE_ROUTE_MAP_COMPILED, "Route map compiled" },
  55. { MTYPE_CMD_TOKENS, "Command desc" },
  56. { MTYPE_KEY, "Key" },
  57. { MTYPE_KEYCHAIN, "Key chain" },
  58. { MTYPE_IF_RMAP, "Interface route map" },
  59. { MTYPE_IF_RMAP_NAME, "I.f. route map name", },
  60. { MTYPE_SOCKUNION, "Socket union" },
  61. { MTYPE_PRIVS, "Privilege information" },
  62. { MTYPE_ZLOG, "Logging" },
  63. { MTYPE_ZCLIENT, "Zclient" },
  64. { MTYPE_WORK_QUEUE, "Work queue" },
  65. { MTYPE_WORK_QUEUE_ITEM, "Work queue item" },
  66. { MTYPE_WORK_QUEUE_NAME, "Work queue name string" },
  67. { MTYPE_PQUEUE, "Priority queue" },
  68. { MTYPE_PQUEUE_DATA, "Priority queue data" },
  69. { MTYPE_HOST, "Host config" },
  70. { MTYPE_VRF, "VRF" },
  71. { MTYPE_VRF_NAME, "VRF name" },
  72. { MTYPE_VRF_BITMAP, "VRF bit-map" },
  73. { MTYPE_IF_LINK_PARAMS, "Informational Link Parameters" },
  74. { -1, NULL },
  75. };
  76. struct memory_list memory_list_zebra[] =
  77. {
  78. { MTYPE_RTADV_PREFIX, "Router Advertisement Prefix" },
  79. { MTYPE_ZEBRA_VRF, "ZEBRA VRF" },
  80. { MTYPE_NEXTHOP, "Nexthop" },
  81. { MTYPE_RIB, "RIB" },
  82. { MTYPE_RIB_QUEUE, "RIB process work queue" },
  83. { MTYPE_STATIC_ROUTE, "Static route" },
  84. { MTYPE_RIB_DEST, "RIB destination" },
  85. { MTYPE_RIB_TABLE_INFO, "RIB table info" },
  86. { MTYPE_NETLINK_NAME, "Netlink name" },
  87. { MTYPE_RNH, "Nexthop tracking object" },
  88. { -1, NULL },
  89. };
  90. struct memory_list memory_list_bgp[] =
  91. {
  92. { MTYPE_BGP, "BGP instance" },
  93. { MTYPE_BGP_LISTENER, "BGP listen socket details" },
  94. { MTYPE_BGP_PEER, "BGP peer" },
  95. { MTYPE_BGP_PEER_HOST, "BGP peer hostname" },
  96. { MTYPE_PEER_GROUP, "Peer group" },
  97. { MTYPE_PEER_DESC, "Peer description" },
  98. { MTYPE_PEER_PASSWORD, "Peer password string" },
  99. { MTYPE_ATTR, "BGP attribute" },
  100. { MTYPE_ATTR_EXTRA, "BGP extra attributes" },
  101. { MTYPE_AS_PATH, "BGP aspath" },
  102. { MTYPE_AS_SEG, "BGP aspath seg" },
  103. { MTYPE_AS_SEG_DATA, "BGP aspath segment data" },
  104. { MTYPE_AS_STR, "BGP aspath str" },
  105. { 0, NULL },
  106. { MTYPE_BGP_TABLE, "BGP table" },
  107. { MTYPE_BGP_NODE, "BGP node" },
  108. { MTYPE_BGP_ROUTE, "BGP route" },
  109. { MTYPE_BGP_ROUTE_EXTRA, "BGP ancillary route info" },
  110. { MTYPE_BGP_CONN, "BGP connected" },
  111. { MTYPE_BGP_STATIC, "BGP static" },
  112. { MTYPE_BGP_ADVERTISE_ATTR, "BGP adv attr" },
  113. { MTYPE_BGP_ADVERTISE, "BGP adv" },
  114. { MTYPE_BGP_SYNCHRONISE, "BGP synchronise" },
  115. { MTYPE_BGP_ADJ_IN, "BGP adj in" },
  116. { MTYPE_BGP_ADJ_OUT, "BGP adj out" },
  117. { MTYPE_BGP_MPATH_INFO, "BGP multipath info" },
  118. { 0, NULL },
  119. { MTYPE_AS_LIST, "BGP AS list" },
  120. { MTYPE_AS_FILTER, "BGP AS filter" },
  121. { MTYPE_AS_FILTER_STR, "BGP AS filter str" },
  122. { 0, NULL },
  123. { MTYPE_COMMUNITY, "community" },
  124. { MTYPE_COMMUNITY_VAL, "community val" },
  125. { MTYPE_COMMUNITY_STR, "community str" },
  126. { 0, NULL },
  127. { MTYPE_ECOMMUNITY, "extcommunity" },
  128. { MTYPE_ECOMMUNITY_VAL, "extcommunity val" },
  129. { MTYPE_ECOMMUNITY_STR, "extcommunity str" },
  130. { 0, NULL },
  131. { MTYPE_COMMUNITY_LIST, "community-list" },
  132. { MTYPE_COMMUNITY_LIST_NAME, "community-list name" },
  133. { MTYPE_COMMUNITY_LIST_ENTRY, "community-list entry" },
  134. { MTYPE_COMMUNITY_LIST_CONFIG, "community-list config" },
  135. { MTYPE_COMMUNITY_LIST_HANDLER, "community-list handler" },
  136. { 0, NULL },
  137. { MTYPE_CLUSTER, "Cluster list" },
  138. { MTYPE_CLUSTER_VAL, "Cluster list val" },
  139. { 0, NULL },
  140. { MTYPE_BGP_PROCESS_QUEUE, "BGP Process queue" },
  141. { MTYPE_BGP_CLEAR_NODE_QUEUE, "BGP node clear queue" },
  142. { 0, NULL },
  143. { MTYPE_TRANSIT, "BGP transit attr" },
  144. { MTYPE_TRANSIT_VAL, "BGP transit val" },
  145. { 0, NULL },
  146. { MTYPE_BGP_DISTANCE, "BGP distance" },
  147. { MTYPE_BGP_NEXTHOP_CACHE, "BGP nexthop" },
  148. { MTYPE_BGP_CONFED_LIST, "BGP confed list" },
  149. { MTYPE_PEER_UPDATE_SOURCE, "BGP peer update interface" },
  150. { MTYPE_BGP_DAMP_INFO, "Dampening info" },
  151. { MTYPE_BGP_DAMP_ARRAY, "BGP Dampening array" },
  152. { MTYPE_BGP_REGEXP, "BGP regexp" },
  153. { MTYPE_BGP_AGGREGATE, "BGP aggregate" },
  154. { MTYPE_BGP_ADDR, "BGP own address" },
  155. { MTYPE_ENCAP_TLV, "ENCAP TLV", },
  156. { -1, NULL }
  157. };
  158. struct memory_list memory_list_rip[] =
  159. {
  160. { MTYPE_RIP, "RIP structure" },
  161. { MTYPE_RIP_INFO, "RIP route info" },
  162. { MTYPE_RIP_INTERFACE, "RIP interface" },
  163. { MTYPE_RIP_PEER, "RIP peer" },
  164. { MTYPE_RIP_OFFSET_LIST, "RIP offset list" },
  165. { MTYPE_RIP_DISTANCE, "RIP distance" },
  166. { -1, NULL }
  167. };
  168. struct memory_list memory_list_ripng[] =
  169. {
  170. { MTYPE_RIPNG, "RIPng structure" },
  171. { MTYPE_RIPNG_ROUTE, "RIPng route info" },
  172. { MTYPE_RIPNG_AGGREGATE, "RIPng aggregate" },
  173. { MTYPE_RIPNG_PEER, "RIPng peer" },
  174. { MTYPE_RIPNG_OFFSET_LIST, "RIPng offset lst" },
  175. { MTYPE_RIPNG_RTE_DATA, "RIPng rte data" },
  176. { -1, NULL }
  177. };
  178. struct memory_list memory_list_babel[] =
  179. {
  180. { MTYPE_BABEL, "Babel structure" },
  181. { MTYPE_BABEL_IF, "Babel interface" },
  182. { -1, NULL }
  183. };
  184. struct memory_list memory_list_ospf[] =
  185. {
  186. { MTYPE_OSPF_TOP, "OSPF top" },
  187. { MTYPE_OSPF_AREA, "OSPF area" },
  188. { MTYPE_OSPF_AREA_RANGE, "OSPF area range" },
  189. { MTYPE_OSPF_NETWORK, "OSPF network" },
  190. { MTYPE_OSPF_NEIGHBOR_STATIC,"OSPF static nbr" },
  191. { MTYPE_OSPF_IF, "OSPF interface" },
  192. { MTYPE_OSPF_NEIGHBOR, "OSPF neighbor" },
  193. { MTYPE_OSPF_ROUTE, "OSPF route" },
  194. { MTYPE_OSPF_TMP, "OSPF tmp mem" },
  195. { MTYPE_OSPF_LSA, "OSPF LSA" },
  196. { MTYPE_OSPF_LSA_DATA, "OSPF LSA data" },
  197. { MTYPE_OSPF_LSDB, "OSPF LSDB" },
  198. { MTYPE_OSPF_PACKET, "OSPF packet" },
  199. { MTYPE_OSPF_FIFO, "OSPF FIFO queue" },
  200. { MTYPE_OSPF_VERTEX, "OSPF vertex" },
  201. { MTYPE_OSPF_VERTEX_PARENT, "OSPF vertex parent", },
  202. { MTYPE_OSPF_NEXTHOP, "OSPF nexthop" },
  203. { MTYPE_OSPF_PATH, "OSPF path" },
  204. { MTYPE_OSPF_VL_DATA, "OSPF VL data" },
  205. { MTYPE_OSPF_CRYPT_KEY, "OSPF crypt key" },
  206. { MTYPE_OSPF_EXTERNAL_INFO, "OSPF ext. info" },
  207. { MTYPE_OSPF_DISTANCE, "OSPF distance" },
  208. { MTYPE_OSPF_IF_INFO, "OSPF if info" },
  209. { MTYPE_OSPF_IF_PARAMS, "OSPF if params" },
  210. { MTYPE_OSPF_MESSAGE, "OSPF message" },
  211. { MTYPE_OSPF_MPLS_TE, "OSPF MPLS parameters" },
  212. { MTYPE_OSPF_PCE_PARAMS, "OSPF PCE parameters" },
  213. { -1, NULL },
  214. };
  215. struct memory_list memory_list_ospf6[] =
  216. {
  217. { MTYPE_OSPF6_TOP, "OSPF6 top" },
  218. { MTYPE_OSPF6_AREA, "OSPF6 area" },
  219. { MTYPE_OSPF6_IF, "OSPF6 interface" },
  220. { MTYPE_OSPF6_NEIGHBOR, "OSPF6 neighbor" },
  221. { MTYPE_OSPF6_ROUTE, "OSPF6 route" },
  222. { MTYPE_OSPF6_PREFIX, "OSPF6 prefix" },
  223. { MTYPE_OSPF6_MESSAGE, "OSPF6 message" },
  224. { MTYPE_OSPF6_LSA, "OSPF6 LSA" },
  225. { MTYPE_OSPF6_LSA_SUMMARY, "OSPF6 LSA summary" },
  226. { MTYPE_OSPF6_LSDB, "OSPF6 LSA database" },
  227. { MTYPE_OSPF6_VERTEX, "OSPF6 vertex" },
  228. { MTYPE_OSPF6_SPFTREE, "OSPF6 SPF tree" },
  229. { MTYPE_OSPF6_NEXTHOP, "OSPF6 nexthop" },
  230. { MTYPE_OSPF6_EXTERNAL_INFO,"OSPF6 ext. info" },
  231. { MTYPE_OSPF6_OTHER, "OSPF6 other" },
  232. { MTYPE_OSPF6_DISTANCE, "OSPF6 distance" },
  233. { -1, NULL },
  234. };
  235. struct memory_list memory_list_isis[] =
  236. {
  237. { MTYPE_ISIS, "ISIS" },
  238. { MTYPE_ISIS_TMP, "ISIS TMP" },
  239. { MTYPE_ISIS_CIRCUIT, "ISIS circuit" },
  240. { MTYPE_ISIS_LSP, "ISIS LSP" },
  241. { MTYPE_ISIS_ADJACENCY, "ISIS adjacency" },
  242. { MTYPE_ISIS_AREA, "ISIS area" },
  243. { MTYPE_ISIS_AREA_ADDR, "ISIS area address" },
  244. { MTYPE_ISIS_TLV, "ISIS TLV" },
  245. { MTYPE_ISIS_DYNHN, "ISIS dyn hostname" },
  246. { MTYPE_ISIS_SPFTREE, "ISIS SPFtree" },
  247. { MTYPE_ISIS_VERTEX, "ISIS vertex" },
  248. { MTYPE_ISIS_ROUTE_INFO, "ISIS route info" },
  249. { MTYPE_ISIS_NEXTHOP, "ISIS nexthop" },
  250. { MTYPE_ISIS_NEXTHOP6, "ISIS nexthop6" },
  251. { MTYPE_ISIS_DICT, "ISIS dictionary" },
  252. { MTYPE_ISIS_DICT_NODE, "ISIS dictionary node" },
  253. { MTYPE_ISIS_MPLS_TE, "ISIS MPLS_TE parameters" },
  254. { -1, NULL },
  255. };
  256. struct memory_list memory_list_pim[] =
  257. {
  258. { MTYPE_PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL" },
  259. { MTYPE_PIM_INTERFACE, "PIM interface" },
  260. { MTYPE_PIM_IGMP_JOIN, "PIM interface IGMP static join" },
  261. { MTYPE_PIM_IGMP_SOCKET, "PIM interface IGMP socket" },
  262. { MTYPE_PIM_IGMP_GROUP, "PIM interface IGMP group" },
  263. { MTYPE_PIM_IGMP_GROUP_SOURCE, "PIM interface IGMP source" },
  264. { MTYPE_PIM_NEIGHBOR, "PIM interface neighbor" },
  265. { MTYPE_PIM_IFCHANNEL, "PIM interface (S,G) state" },
  266. { MTYPE_PIM_UPSTREAM, "PIM upstream (S,G) state" },
  267. { MTYPE_PIM_SSMPINGD, "PIM sspimgd socket" },
  268. { MTYPE_PIM_STATIC_ROUTE, "PIM Static Route" },
  269. { -1, NULL },
  270. };
  271. struct memory_list memory_list_nhrp[] =
  272. {
  273. { MTYPE_NHRP_IF, "NHRP interface" },
  274. { MTYPE_NHRP_VC, "NHRP virtual connection" },
  275. { MTYPE_NHRP_PEER, "NHRP peer entry" },
  276. { MTYPE_NHRP_CACHE, "NHRP cache entry" },
  277. { MTYPE_NHRP_NHS, "NHRP next hop server" },
  278. { MTYPE_NHRP_REGISTRATION, "NHRP registration entries" },
  279. { MTYPE_NHRP_SHORTCUT, "NHRP shortcut" },
  280. { MTYPE_NHRP_ROUTE, "NHRP routing entry" },
  281. { -1, NULL }
  282. };
  283. struct memory_list memory_list_vtysh[] =
  284. {
  285. { MTYPE_VTYSH_CONFIG, "Vtysh configuration", },
  286. { MTYPE_VTYSH_CONFIG_LINE, "Vtysh configuration line" },
  287. { -1, NULL },
  288. };
  289. struct mlist mlists[] __attribute__ ((unused)) = {
  290. { memory_list_lib, "LIB" },
  291. { memory_list_zebra, "ZEBRA" },
  292. { memory_list_rip, "RIP" },
  293. { memory_list_ripng, "RIPNG" },
  294. { memory_list_ospf, "OSPF" },
  295. { memory_list_ospf6, "OSPF6" },
  296. { memory_list_isis, "ISIS" },
  297. { memory_list_bgp, "BGP" },
  298. { memory_list_pim, "PIM" },
  299. { memory_list_nhrp, "NHRP" },
  300. { NULL, NULL},
  301. };