blob: 8e2c4faa2b35783d74e5194238b84cb23405eef0 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
2 * Memory management routine
3 * Copyright (C) 1998 Kunihiro Ishiguro
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22
23#include <zebra.h>
24
25#include "log.h"
26#include "memory.h"
27
ajsf858e492004-11-16 14:25:30 +000028static void alloc_inc (int);
29static void alloc_dec (int);
ajs7fa25ff2004-11-15 16:12:32 +000030static void log_memstats(int log_priority);
paul718e3742002-12-13 20:15:29 +000031
ajsf858e492004-11-16 14:25:30 +000032static struct message mstr [] =
paul718e3742002-12-13 20:15:29 +000033{
34 { MTYPE_THREAD, "thread" },
35 { MTYPE_THREAD_MASTER, "thread_master" },
36 { MTYPE_VECTOR, "vector" },
37 { MTYPE_VECTOR_INDEX, "vector_index" },
38 { MTYPE_IF, "interface" },
39 { 0, NULL },
40};
41
42/* Fatal memory allocation error occured. */
43static void
44zerror (const char *fname, int type, size_t size)
45{
ajs7fa25ff2004-11-15 16:12:32 +000046 zlog_err ("%s : can't allocate memory for `%s' size %d: %s\n",
ajs6099b3b2004-11-20 02:06:59 +000047 fname, lookup (mstr, type), (int) size, safe_strerror(errno));
ajs7fa25ff2004-11-15 16:12:32 +000048 log_memstats(LOG_WARNING);
ajs48d6c692004-11-26 20:52:59 +000049 /* N.B. It might be preferable to call zlog_backtrace_sigsafe here, since
ajs063ee522004-11-26 18:11:14 +000050 that function should definitely be safe in an OOM condition. But
ajs48d6c692004-11-26 20:52:59 +000051 unfortunately zlog_backtrace_sigsafe does not support syslog logging at
ajs063ee522004-11-26 18:11:14 +000052 this time... */
53 zlog_backtrace(LOG_WARNING);
ajs7fa25ff2004-11-15 16:12:32 +000054 abort();
paul718e3742002-12-13 20:15:29 +000055}
56
57/* Memory allocation. */
58void *
59zmalloc (int type, size_t size)
60{
61 void *memory;
62
63 memory = malloc (size);
64
65 if (memory == NULL)
66 zerror ("malloc", type, size);
67
68 alloc_inc (type);
69
70 return memory;
71}
72
73/* Memory allocation with num * size with cleared. */
74void *
75zcalloc (int type, size_t size)
76{
77 void *memory;
78
79 memory = calloc (1, size);
80
81 if (memory == NULL)
82 zerror ("calloc", type, size);
83
84 alloc_inc (type);
85
86 return memory;
87}
88
89/* Memory reallocation. */
90void *
91zrealloc (int type, void *ptr, size_t size)
92{
93 void *memory;
94
95 memory = realloc (ptr, size);
96 if (memory == NULL)
97 zerror ("realloc", type, size);
98 return memory;
99}
100
101/* Memory free. */
102void
103zfree (int type, void *ptr)
104{
105 alloc_dec (type);
106 free (ptr);
107}
108
109/* String duplication. */
110char *
hassob04c6992004-10-04 19:10:31 +0000111zstrdup (int type, const char *str)
paul718e3742002-12-13 20:15:29 +0000112{
113 void *dup;
114
115 dup = strdup (str);
116 if (dup == NULL)
117 zerror ("strdup", type, strlen (str));
118 alloc_inc (type);
119 return dup;
120}
121
122#ifdef MEMORY_LOG
ajsf858e492004-11-16 14:25:30 +0000123static struct
paul718e3742002-12-13 20:15:29 +0000124{
hassob04c6992004-10-04 19:10:31 +0000125 const char *name;
paul718e3742002-12-13 20:15:29 +0000126 unsigned long alloc;
127 unsigned long t_malloc;
128 unsigned long c_malloc;
129 unsigned long t_calloc;
130 unsigned long c_calloc;
131 unsigned long t_realloc;
132 unsigned long t_free;
133 unsigned long c_strdup;
134} mstat [MTYPE_MAX];
135
ajsf858e492004-11-16 14:25:30 +0000136static void
paul718e3742002-12-13 20:15:29 +0000137mtype_log (char *func, void *memory, const char *file, int line, int type)
138{
139 zlog_info ("%s: %s %p %s %d", func, lookup (mstr, type), memory, file, line);
140}
141
142void *
143mtype_zmalloc (const char *file, int line, int type, size_t size)
144{
145 void *memory;
146
147 mstat[type].c_malloc++;
148 mstat[type].t_malloc++;
149
150 memory = zmalloc (type, size);
151 mtype_log ("zmalloc", memory, file, line, type);
152
153 return memory;
154}
155
156void *
157mtype_zcalloc (const char *file, int line, int type, size_t size)
158{
159 void *memory;
160
161 mstat[type].c_calloc++;
162 mstat[type].t_calloc++;
163
164 memory = zcalloc (type, size);
165 mtype_log ("xcalloc", memory, file, line, type);
166
167 return memory;
168}
169
170void *
171mtype_zrealloc (const char *file, int line, int type, void *ptr, size_t size)
172{
173 void *memory;
174
175 /* Realloc need before allocated pointer. */
176 mstat[type].t_realloc++;
177
178 memory = zrealloc (type, ptr, size);
179
180 mtype_log ("xrealloc", memory, file, line, type);
181
182 return memory;
183}
184
185/* Important function. */
186void
187mtype_zfree (const char *file, int line, int type, void *ptr)
188{
189 mstat[type].t_free++;
190
191 mtype_log ("xfree", ptr, file, line, type);
192
193 zfree (type, ptr);
194}
195
196char *
hassob04c6992004-10-04 19:10:31 +0000197mtype_zstrdup (const char *file, int line, int type, const char *str)
paul718e3742002-12-13 20:15:29 +0000198{
199 char *memory;
200
201 mstat[type].c_strdup++;
202
203 memory = zstrdup (type, str);
204
205 mtype_log ("xstrdup", memory, file, line, type);
206
207 return memory;
208}
209#else
ajsf858e492004-11-16 14:25:30 +0000210static struct
paul718e3742002-12-13 20:15:29 +0000211{
212 char *name;
213 unsigned long alloc;
214} mstat [MTYPE_MAX];
215#endif /* MTPYE_LOG */
216
217/* Increment allocation counter. */
ajsf858e492004-11-16 14:25:30 +0000218static void
paul718e3742002-12-13 20:15:29 +0000219alloc_inc (int type)
220{
221 mstat[type].alloc++;
222}
223
224/* Decrement allocation counter. */
ajsf858e492004-11-16 14:25:30 +0000225static void
paul718e3742002-12-13 20:15:29 +0000226alloc_dec (int type)
227{
228 mstat[type].alloc--;
229}
230
231/* Looking up memory status from vty interface. */
232#include "vector.h"
233#include "vty.h"
234#include "command.h"
235
236/* For pretty printng of memory allocate information. */
237struct memory_list
238{
239 int index;
hassob04c6992004-10-04 19:10:31 +0000240 const char *format;
paul718e3742002-12-13 20:15:29 +0000241};
242
ajsf858e492004-11-16 14:25:30 +0000243static struct memory_list memory_list_lib[] =
paul718e3742002-12-13 20:15:29 +0000244{
245 { MTYPE_TMP, "Temporary memory" },
246 { MTYPE_ROUTE_TABLE, "Route table " },
247 { MTYPE_ROUTE_NODE, "Route node " },
248 { MTYPE_RIB, "RIB " },
paul9035efa2004-10-10 11:56:56 +0000249 { MTYPE_DISTRIBUTE, "Distribute list " },
250 { MTYPE_DISTRIBUTE_IFNAME, "Dist-list ifname" },
paul718e3742002-12-13 20:15:29 +0000251 { MTYPE_NEXTHOP, "Nexthop " },
252 { MTYPE_LINK_LIST, "Link List " },
253 { MTYPE_LINK_NODE, "Link Node " },
254 { MTYPE_HASH, "Hash " },
255 { MTYPE_HASH_BACKET, "Hash Bucket " },
256 { MTYPE_ACCESS_LIST, "Access List " },
257 { MTYPE_ACCESS_LIST_STR, "Access List Str " },
258 { MTYPE_ACCESS_FILTER, "Access Filter " },
259 { MTYPE_PREFIX_LIST, "Prefix List " },
260 { MTYPE_PREFIX_LIST_STR, "Prefix List Str " },
261 { MTYPE_PREFIX_LIST_ENTRY, "Prefix List Entry "},
262 { MTYPE_ROUTE_MAP, "Route map " },
263 { MTYPE_ROUTE_MAP_NAME, "Route map name " },
264 { MTYPE_ROUTE_MAP_INDEX, "Route map index " },
265 { MTYPE_ROUTE_MAP_RULE, "Route map rule " },
266 { MTYPE_ROUTE_MAP_RULE_STR, "Route map rule str" },
hassoa94434b2003-05-25 17:10:12 +0000267 { MTYPE_ROUTE_MAP_COMPILED, "Route map compiled" },
paul718e3742002-12-13 20:15:29 +0000268 { MTYPE_DESC, "Command desc " },
269 { MTYPE_BUFFER, "Buffer " },
270 { MTYPE_BUFFER_DATA, "Buffer data " },
271 { MTYPE_STREAM, "Stream " },
272 { MTYPE_KEYCHAIN, "Key chain " },
273 { MTYPE_KEY, "Key " },
274 { MTYPE_VTY, "VTY " },
275 { -1, NULL }
276};
277
ajsf858e492004-11-16 14:25:30 +0000278static struct memory_list memory_list_bgp[] =
paul718e3742002-12-13 20:15:29 +0000279{
280 { MTYPE_BGP_PEER, "BGP peer" },
281 { MTYPE_ATTR, "BGP attribute" },
282 { MTYPE_AS_PATH, "BGP aspath" },
283 { MTYPE_AS_SEG, "BGP aspath seg" },
284 { MTYPE_AS_STR, "BGP aspath str" },
285 { 0, NULL },
286 { MTYPE_BGP_TABLE, "BGP table" },
287 { MTYPE_BGP_NODE, "BGP node" },
288 { MTYPE_BGP_ADVERTISE_ATTR, "BGP adv attr" },
289 { MTYPE_BGP_ADVERTISE, "BGP adv" },
290 { MTYPE_BGP_ADJ_IN, "BGP adj in" },
291 { MTYPE_BGP_ADJ_OUT, "BGP adj out" },
292 { 0, NULL },
293 { MTYPE_AS_LIST, "BGP AS list" },
294 { MTYPE_AS_FILTER, "BGP AS filter" },
295 { MTYPE_AS_FILTER_STR, "BGP AS filter str" },
296 { 0, NULL },
297 { MTYPE_COMMUNITY, "community" },
298 { MTYPE_COMMUNITY_VAL, "community val" },
299 { MTYPE_COMMUNITY_STR, "community str" },
300 { 0, NULL },
301 { MTYPE_ECOMMUNITY, "extcommunity" },
302 { MTYPE_ECOMMUNITY_VAL, "extcommunity val" },
303 { MTYPE_ECOMMUNITY_STR, "extcommunity str" },
304 { 0, NULL },
305 { MTYPE_COMMUNITY_LIST, "community-list" },
306 { MTYPE_COMMUNITY_LIST_NAME, "community-list name" },
307 { MTYPE_COMMUNITY_LIST_ENTRY, "community-list entry" },
308 { MTYPE_COMMUNITY_LIST_CONFIG, "community-list config" },
309 { 0, NULL },
310 { MTYPE_CLUSTER, "Cluster list" },
311 { MTYPE_CLUSTER_VAL, "Cluster list val" },
312 { 0, NULL },
313 { MTYPE_TRANSIT, "BGP transit attr" },
314 { MTYPE_TRANSIT_VAL, "BGP transit val" },
315 { 0, NULL },
316 { MTYPE_BGP_DISTANCE, "BGP distance" },
317 { MTYPE_BGP_NEXTHOP_CACHE, "BGP nexthop" },
318 { MTYPE_BGP_CONFED_LIST, "BGP confed list" },
319 { MTYPE_PEER_UPDATE_SOURCE, "peer update if" },
320 { MTYPE_BGP_DAMP_INFO, "Dampening info" },
321 { MTYPE_BGP_REGEXP, "BGP regexp" },
322 { -1, NULL }
323};
324
ajsf858e492004-11-16 14:25:30 +0000325static struct memory_list memory_list_rip[] =
paul718e3742002-12-13 20:15:29 +0000326{
327 { MTYPE_RIP, "RIP structure " },
328 { MTYPE_RIP_INFO, "RIP route info " },
329 { MTYPE_RIP_INTERFACE, "RIP interface " },
330 { MTYPE_RIP_PEER, "RIP peer " },
331 { MTYPE_RIP_OFFSET_LIST, "RIP offset list " },
332 { MTYPE_RIP_DISTANCE, "RIP distance " },
333 { -1, NULL }
334};
335
ajsf858e492004-11-16 14:25:30 +0000336static struct memory_list memory_list_ripng[] =
hassoa94434b2003-05-25 17:10:12 +0000337{
338 { MTYPE_RIPNG, "RIPng structure " },
339 { MTYPE_RIPNG_ROUTE, "RIPng route info" },
340 { MTYPE_RIPNG_AGGREGATE, "RIPng aggregate " },
341 { MTYPE_RIPNG_PEER, "RIPng peer " },
342 { MTYPE_RIPNG_OFFSET_LIST, "RIPng offset lst" },
343 { MTYPE_RIPNG_RTE_DATA, "RIPng rte data " },
344 { -1, NULL }
345};
346
ajsf858e492004-11-16 14:25:30 +0000347static struct memory_list memory_list_ospf[] =
paul718e3742002-12-13 20:15:29 +0000348{
349 { MTYPE_OSPF_TOP, "OSPF top " },
350 { MTYPE_OSPF_AREA, "OSPF area " },
351 { MTYPE_OSPF_AREA_RANGE, "OSPF area range " },
352 { MTYPE_OSPF_NETWORK, "OSPF network " },
353#ifdef NBMA_ENABLE
354 { MTYPE_OSPF_NEIGHBOR_STATIC,"OSPF static nbr " },
355#endif /* NBMA_ENABLE */
356 { MTYPE_OSPF_IF, "OSPF interface " },
357 { MTYPE_OSPF_NEIGHBOR, "OSPF neighbor " },
358 { MTYPE_OSPF_ROUTE, "OSPF route " },
359 { MTYPE_OSPF_TMP, "OSPF tmp mem " },
360 { MTYPE_OSPF_LSA, "OSPF LSA " },
361 { MTYPE_OSPF_LSA_DATA, "OSPF LSA data " },
362 { MTYPE_OSPF_LSDB, "OSPF LSDB " },
363 { MTYPE_OSPF_PACKET, "OSPF packet " },
364 { MTYPE_OSPF_FIFO, "OSPF FIFO queue " },
365 { MTYPE_OSPF_VERTEX, "OSPF vertex " },
366 { MTYPE_OSPF_NEXTHOP, "OSPF nexthop " },
367 { MTYPE_OSPF_PATH, "OSPF path " },
368 { MTYPE_OSPF_VL_DATA, "OSPF VL data " },
369 { MTYPE_OSPF_CRYPT_KEY, "OSPF crypt key " },
370 { MTYPE_OSPF_EXTERNAL_INFO, "OSPF ext. info " },
371 { MTYPE_OSPF_DISTANCE, "OSPF distance " },
372 { MTYPE_OSPF_IF_INFO, "OSPF if info " },
373 { MTYPE_OSPF_IF_PARAMS, "OSPF if params " },
374 { -1, NULL },
375};
376
ajsf858e492004-11-16 14:25:30 +0000377static struct memory_list memory_list_ospf6[] =
paul718e3742002-12-13 20:15:29 +0000378{
379 { MTYPE_OSPF6_TOP, "OSPF6 top " },
380 { MTYPE_OSPF6_AREA, "OSPF6 area " },
381 { MTYPE_OSPF6_IF, "OSPF6 interface " },
382 { MTYPE_OSPF6_NEIGHBOR, "OSPF6 neighbor " },
383 { MTYPE_OSPF6_ROUTE, "OSPF6 route " },
384 { MTYPE_OSPF6_PREFIX, "OSPF6 prefix " },
385 { MTYPE_OSPF6_MESSAGE, "OSPF6 message " },
386 { MTYPE_OSPF6_LSA, "OSPF6 LSA " },
387 { MTYPE_OSPF6_LSA_SUMMARY, "OSPF6 LSA summary " },
388 { MTYPE_OSPF6_LSDB, "OSPF6 LSA database" },
389 { MTYPE_OSPF6_VERTEX, "OSPF6 vertex " },
390 { MTYPE_OSPF6_SPFTREE, "OSPF6 SPF tree " },
391 { MTYPE_OSPF6_NEXTHOP, "OSPF6 nexthop " },
392 { MTYPE_OSPF6_EXTERNAL_INFO,"OSPF6 ext. info " },
393 { MTYPE_OSPF6_OTHER, "OSPF6 other " },
394 { -1, NULL },
395};
396
ajsf858e492004-11-16 14:25:30 +0000397static struct memory_list memory_list_isis[] =
jardin9e867fe2003-12-23 08:56:18 +0000398{
399 { MTYPE_ISIS, "ISIS " },
400 { MTYPE_ISIS_TMP, "ISIS TMP " },
401 { MTYPE_ISIS_CIRCUIT, "ISIS circuit " },
402 { MTYPE_ISIS_LSP, "ISIS LSP " },
403 { MTYPE_ISIS_ADJACENCY, "ISIS adjacency " },
404 { MTYPE_ISIS_AREA, "ISIS area " },
405 { MTYPE_ISIS_AREA_ADDR, "ISIS area address " },
406 { MTYPE_ISIS_TLV, "ISIS TLV " },
407 { MTYPE_ISIS_DYNHN, "ISIS dyn hostname " },
408 { MTYPE_ISIS_SPFTREE, "ISIS SPFtree " },
409 { MTYPE_ISIS_VERTEX, "ISIS vertex " },
410 { MTYPE_ISIS_ROUTE_INFO, "ISIS route info " },
411 { MTYPE_ISIS_NEXTHOP, "ISIS nexthop " },
412 { MTYPE_ISIS_NEXTHOP6, "ISIS nexthop6 " },
413 { -1, NULL },
414};
415
ajs7fa25ff2004-11-15 16:12:32 +0000416static struct mlist {
417 struct memory_list *list;
418 const char *name;
419} mlists[] = {
420 { memory_list_lib, "LIB"},
421 { memory_list_rip, "RIP"},
422 { memory_list_ripng, "RIPNG"},
423 { memory_list_ospf, "OSPF"},
424 { memory_list_ospf6, "OSPF6"},
425 { memory_list_isis, "ISIS"},
426 { memory_list_bgp, "BGP"},
427 { NULL, NULL},
428};
429
430static void
431log_memstats(int pri)
432{
433 struct mlist *ml;
434
435 for (ml = mlists; ml->list; ml++)
436 {
437 struct memory_list *m;
438
439 zlog (NULL, pri, "Memory utilization in module %s:", ml->name);
440 for (m = ml->list; m->index >= 0; m++)
441 if (m->index && mstat[m->index].alloc)
442 zlog (NULL, pri, " %-22s: %5ld", m->format, mstat[m->index].alloc);
443 }
444}
445
ajsf858e492004-11-16 14:25:30 +0000446static struct memory_list memory_list_separator[] =
paul718e3742002-12-13 20:15:29 +0000447{
448 { 0, NULL},
449 {-1, NULL}
450};
451
ajsf858e492004-11-16 14:25:30 +0000452static void
paul718e3742002-12-13 20:15:29 +0000453show_memory_vty (struct vty *vty, struct memory_list *list)
454{
455 struct memory_list *m;
456
457 for (m = list; m->index >= 0; m++)
458 if (m->index == 0)
459 vty_out (vty, "-----------------------------\r\n");
460 else
461 vty_out (vty, "%-22s: %5ld\r\n", m->format, mstat[m->index].alloc);
462}
463
464DEFUN (show_memory_all,
465 show_memory_all_cmd,
466 "show memory all",
467 "Show running system information\n"
468 "Memory statistics\n"
469 "All memory statistics\n")
470{
ajs7fa25ff2004-11-15 16:12:32 +0000471 struct mlist *ml;
472
473 for (ml = mlists; ml->list; ml++)
474 {
475 if (ml != mlists)
476 show_memory_vty (vty, memory_list_separator);
477 show_memory_vty (vty, ml->list);
478 }
paul718e3742002-12-13 20:15:29 +0000479
480 return CMD_SUCCESS;
481}
482
483ALIAS (show_memory_all,
484 show_memory_cmd,
485 "show memory",
486 "Show running system information\n"
487 "Memory statistics\n")
488
489DEFUN (show_memory_lib,
490 show_memory_lib_cmd,
491 "show memory lib",
492 SHOW_STR
493 "Memory statistics\n"
494 "Library memory\n")
495{
496 show_memory_vty (vty, memory_list_lib);
497 return CMD_SUCCESS;
498}
499
500DEFUN (show_memory_rip,
501 show_memory_rip_cmd,
502 "show memory rip",
503 SHOW_STR
504 "Memory statistics\n"
505 "RIP memory\n")
506{
507 show_memory_vty (vty, memory_list_rip);
508 return CMD_SUCCESS;
509}
510
hassoa94434b2003-05-25 17:10:12 +0000511DEFUN (show_memory_ripng,
512 show_memory_ripng_cmd,
513 "show memory ripng",
514 SHOW_STR
515 "Memory statistics\n"
516 "RIPng memory\n")
517{
518 show_memory_vty (vty, memory_list_ripng);
519 return CMD_SUCCESS;
520}
521
paul718e3742002-12-13 20:15:29 +0000522DEFUN (show_memory_bgp,
523 show_memory_bgp_cmd,
524 "show memory bgp",
525 SHOW_STR
526 "Memory statistics\n"
527 "BGP memory\n")
528{
529 show_memory_vty (vty, memory_list_bgp);
530 return CMD_SUCCESS;
531}
532
533DEFUN (show_memory_ospf,
534 show_memory_ospf_cmd,
535 "show memory ospf",
536 SHOW_STR
537 "Memory statistics\n"
538 "OSPF memory\n")
539{
540 show_memory_vty (vty, memory_list_ospf);
541 return CMD_SUCCESS;
542}
543
544DEFUN (show_memory_ospf6,
545 show_memory_ospf6_cmd,
546 "show memory ospf6",
547 SHOW_STR
548 "Memory statistics\n"
549 "OSPF6 memory\n")
550{
551 show_memory_vty (vty, memory_list_ospf6);
552 return CMD_SUCCESS;
553}
554
jardin9e867fe2003-12-23 08:56:18 +0000555DEFUN (show_memory_isis,
556 show_memory_isis_cmd,
557 "show memory isis",
558 SHOW_STR
559 "Memory statistics\n"
560 "ISIS memory\n")
561{
562 show_memory_vty (vty, memory_list_isis);
563 return CMD_SUCCESS;
564}
565
paul718e3742002-12-13 20:15:29 +0000566void
ajsf858e492004-11-16 14:25:30 +0000567memory_init (void)
paul718e3742002-12-13 20:15:29 +0000568{
569 install_element (VIEW_NODE, &show_memory_cmd);
570 install_element (VIEW_NODE, &show_memory_all_cmd);
571 install_element (VIEW_NODE, &show_memory_lib_cmd);
572 install_element (VIEW_NODE, &show_memory_rip_cmd);
hassoa94434b2003-05-25 17:10:12 +0000573 install_element (VIEW_NODE, &show_memory_ripng_cmd);
paul718e3742002-12-13 20:15:29 +0000574 install_element (VIEW_NODE, &show_memory_bgp_cmd);
575 install_element (VIEW_NODE, &show_memory_ospf_cmd);
576 install_element (VIEW_NODE, &show_memory_ospf6_cmd);
jardin9e867fe2003-12-23 08:56:18 +0000577 install_element (VIEW_NODE, &show_memory_isis_cmd);
paul718e3742002-12-13 20:15:29 +0000578
579 install_element (ENABLE_NODE, &show_memory_cmd);
580 install_element (ENABLE_NODE, &show_memory_all_cmd);
581 install_element (ENABLE_NODE, &show_memory_lib_cmd);
582 install_element (ENABLE_NODE, &show_memory_rip_cmd);
hassoa94434b2003-05-25 17:10:12 +0000583 install_element (ENABLE_NODE, &show_memory_ripng_cmd);
paul718e3742002-12-13 20:15:29 +0000584 install_element (ENABLE_NODE, &show_memory_bgp_cmd);
585 install_element (ENABLE_NODE, &show_memory_ospf_cmd);
586 install_element (ENABLE_NODE, &show_memory_ospf6_cmd);
jardin9e867fe2003-12-23 08:56:18 +0000587 install_element (ENABLE_NODE, &show_memory_isis_cmd);
paul718e3742002-12-13 20:15:29 +0000588}