]> git.proxmox.com Git - mirror_iproute2.git/blame - include/names.h
Merge branch 'rate-size-parsing-output' into next
[mirror_iproute2.git] / include / names.h
CommitLineData
6054c1eb 1/* SPDX-License-Identifier: GPL-2.0 */
4612d04d
VK
2#ifndef DB_NAMES_H_
3#define DB_NAMES_H_ 1
4
5#define IDNAME_MAX 256
6
7struct db_entry {
8 struct db_entry *next;
9 unsigned int id;
10 char *name;
11};
12
13struct db_names {
14 unsigned int size;
15 struct db_entry *cached;
16 struct db_entry **hash;
17 int max;
18};
19
8b90a990
VK
20struct db_names *db_names_alloc(void);
21int db_names_load(struct db_names *db, const char *path);
4612d04d
VK
22void db_names_free(struct db_names *db);
23
24char *id_to_name(struct db_names *db, int id, char *name);
4612d04d
VK
25
26#endif