blob: 54c11aff743287a00cd5f645862940feebd5f68c [file] [log] [blame]
Damjan Marion8973b072022-03-01 15:51:18 +01001/* SPDX-License-Identifier: Apache-2.0
2 * Copyright(c) 2022 Cisco Systems, Inc.
3 */
4
5#include <vlib/vlib.h>
6#include <vlib/unix/unix.h>
7#include <vlib/stats/stats.h>
8
9u8 *
10format_vlib_stats_symlink (u8 *s, va_list *args)
11{
Damjan Marionc5d81b92022-04-15 15:53:17 +020012 u8 *input = va_arg (*args, u8 *);
Damjan Marion8973b072022-03-01 15:51:18 +010013
Damjan Marionc5d81b92022-04-15 15:53:17 +020014 for (int i = 0; i < vec_len (input); i++)
15 if (input[i] == '/')
16 vec_add1 (s, '_');
17 else
18 vec_add1 (s, input[i]);
Damjan Marion8973b072022-03-01 15:51:18 +010019
Damjan Marionc5d81b92022-04-15 15:53:17 +020020 return s;
Damjan Marion8973b072022-03-01 15:51:18 +010021}