Lines Matching refs:nsid
139 int nsid; member
144 #define NSID_HASH_NSID(nsid) (nsid & (NSIDMAP_SIZE - 1)) argument
150 static struct nsid_cache *netns_map_get_by_nsid(int nsid) in netns_map_get_by_nsid() argument
152 uint32_t h = NSID_HASH_NSID(nsid); in netns_map_get_by_nsid()
158 if (c->nsid == nsid) in netns_map_get_by_nsid()
165 static int netns_map_add(int nsid, const char *name) in netns_map_add() argument
170 if (netns_map_get_by_nsid(nsid) != NULL) in netns_map_add()
178 c->nsid = nsid; in netns_map_add()
181 h = NSID_HASH_NSID(nsid); in netns_map_add()
214 int nsid; in netns_map_init() local
228 nsid = get_netnsid_from_name(entry->d_name); in netns_map_init()
230 if (nsid >= 0) in netns_map_init()
231 netns_map_add(nsid, entry->d_name); in netns_map_init()
237 static int netns_get_name(int nsid, char *name) in netns_get_name() argument
254 if (nsid == id) { in netns_get_name()
272 int nsid; in print_nsid() local
293 nsid = rta_getattr_u32(tb[NETNSA_NSID]); in print_nsid()
294 fprintf(fp, "nsid %u ", nsid); in print_nsid()
296 c = netns_map_get_by_nsid(nsid); in print_nsid()
304 if (netns_get_name(nsid, name) == 0) { in print_nsid()
306 netns_map_add(nsid, name); in print_nsid()
672 static int set_netnsid_from_name(const char *name, int nsid) in set_netnsid_from_name() argument
691 addattr32(&req.n, 1024, NETNSA_NSID, nsid); in set_netnsid_from_name()
703 unsigned int nsid; in netns_set() local
715 if (get_unsigned(&nsid, argv[1], 0)) in netns_set()
726 return set_netnsid_from_name(name, nsid); in netns_set()