• Home
  • Raw
  • Download

Lines Matching refs:id

34 	unsigned int		id;  member
37 static int fread_id_name(FILE *fp, int *id, char *namebuf) in fread_id_name() argument
50 if (sscanf(p, "0x%x %s\n", id, namebuf) != 2 && in fread_id_name()
51 sscanf(p, "0x%x %s #", id, namebuf) != 2 && in fread_id_name()
52 sscanf(p, "%d %s\n", id, namebuf) != 2 && in fread_id_name()
53 sscanf(p, "%d %s #", id, namebuf) != 2) { in fread_id_name()
67 int id; in rtnl_hash_initialize() local
75 while ((ret = fread_id_name(fp, &id, &namebuf[0]))) { in rtnl_hash_initialize()
83 if (id < 0) in rtnl_hash_initialize()
87 entry->id = id; in rtnl_hash_initialize()
89 entry->next = hash[id & (size - 1)]; in rtnl_hash_initialize()
90 hash[id & (size - 1)] = entry; in rtnl_hash_initialize()
98 int id; in rtnl_tab_initialize() local
106 while ((ret = fread_id_name(fp, &id, &namebuf[0]))) { in rtnl_tab_initialize()
113 if (id < 0 || id > size) in rtnl_tab_initialize()
116 tab[id] = strdup(namebuf); in rtnl_tab_initialize()
177 const char *rtnl_rtprot_n2a(int id, char *buf, int len) in rtnl_rtprot_n2a() argument
179 if (id < 0 || id >= 256) { in rtnl_rtprot_n2a()
180 snprintf(buf, len, "%u", id); in rtnl_rtprot_n2a()
183 if (!rtnl_rtprot_tab[id]) { in rtnl_rtprot_n2a()
187 if (rtnl_rtprot_tab[id]) in rtnl_rtprot_n2a()
188 return rtnl_rtprot_tab[id]; in rtnl_rtprot_n2a()
189 snprintf(buf, len, "%u", id); in rtnl_rtprot_n2a()
193 int rtnl_rtprot_a2n(__u32 *id, const char *arg) in rtnl_rtprot_a2n() argument
201 *id = res; in rtnl_rtprot_a2n()
213 *id = res; in rtnl_rtprot_a2n()
221 *id = res; in rtnl_rtprot_a2n()
243 const char *rtnl_rtscope_n2a(int id, char *buf, int len) in rtnl_rtscope_n2a() argument
245 if (id < 0 || id >= 256) { in rtnl_rtscope_n2a()
246 snprintf(buf, len, "%d", id); in rtnl_rtscope_n2a()
250 if (!rtnl_rtscope_tab[id]) { in rtnl_rtscope_n2a()
255 if (rtnl_rtscope_tab[id]) in rtnl_rtscope_n2a()
256 return rtnl_rtscope_tab[id]; in rtnl_rtscope_n2a()
258 snprintf(buf, len, "%d", id); in rtnl_rtscope_n2a()
262 int rtnl_rtscope_a2n(__u32 *id, const char *arg) in rtnl_rtscope_a2n() argument
270 *id = res; in rtnl_rtscope_a2n()
282 *id = res; in rtnl_rtscope_a2n()
290 *id = res; in rtnl_rtscope_a2n()
308 const char *rtnl_rtrealm_n2a(int id, char *buf, int len) in rtnl_rtrealm_n2a() argument
310 if (id < 0 || id >= 256) { in rtnl_rtrealm_n2a()
311 snprintf(buf, len, "%d", id); in rtnl_rtrealm_n2a()
314 if (!rtnl_rtrealm_tab[id]) { in rtnl_rtrealm_n2a()
318 if (rtnl_rtrealm_tab[id]) in rtnl_rtrealm_n2a()
319 return rtnl_rtrealm_tab[id]; in rtnl_rtrealm_n2a()
320 snprintf(buf, len, "%d", id); in rtnl_rtrealm_n2a()
325 int rtnl_rtrealm_a2n(__u32 *id, const char *arg) in rtnl_rtrealm_a2n() argument
333 *id = res; in rtnl_rtrealm_a2n()
345 *id = res; in rtnl_rtrealm_a2n()
353 *id = res; in rtnl_rtrealm_a2n()
379 rtnl_rttable_hash[i]->id = i; in rtnl_rttable_initialize()
409 const char *rtnl_rttable_n2a(__u32 id, char *buf, int len) in rtnl_rttable_n2a() argument
415 entry = rtnl_rttable_hash[id & 255]; in rtnl_rttable_n2a()
416 while (entry && entry->id != id) in rtnl_rttable_n2a()
420 snprintf(buf, len, "%u", id); in rtnl_rttable_n2a()
424 int rtnl_rttable_a2n(__u32 *id, const char *arg) in rtnl_rttable_a2n() argument
433 *id = res; in rtnl_rttable_a2n()
446 res = entry->id; in rtnl_rttable_a2n()
447 *id = res; in rtnl_rttable_a2n()
455 *id = i; in rtnl_rttable_a2n()
473 const char *rtnl_dsfield_n2a(int id, char *buf, int len) in rtnl_dsfield_n2a() argument
475 if (id < 0 || id >= 256) { in rtnl_dsfield_n2a()
476 snprintf(buf, len, "%d", id); in rtnl_dsfield_n2a()
479 if (!rtnl_rtdsfield_tab[id]) { in rtnl_dsfield_n2a()
483 if (rtnl_rtdsfield_tab[id]) in rtnl_dsfield_n2a()
484 return rtnl_rtdsfield_tab[id]; in rtnl_dsfield_n2a()
485 snprintf(buf, len, "0x%02x", id); in rtnl_dsfield_n2a()
490 int rtnl_dsfield_a2n(__u32 *id, const char *arg) in rtnl_dsfield_a2n() argument
498 *id = res; in rtnl_dsfield_a2n()
510 *id = res; in rtnl_dsfield_a2n()
518 *id = res; in rtnl_dsfield_a2n()
524 .id = 0, .name = "default"
540 int rtnl_group_a2n(int *id, const char *arg) in rtnl_group_a2n() argument
549 *id = res; in rtnl_group_a2n()
562 res = entry->id; in rtnl_group_a2n()
563 *id = res; in rtnl_group_a2n()
571 *id = i; in rtnl_group_a2n()
575 const char *rtnl_group_n2a(int id, char *buf, int len) in rtnl_group_n2a() argument
587 if (entry->id == id) in rtnl_group_n2a()
593 snprintf(buf, len, "%d", id); in rtnl_group_n2a()
630 const char *nl_proto_n2a(int id, char *buf, int len) in nl_proto_n2a() argument
632 if (id < 0 || id >= 256) { in nl_proto_n2a()
633 snprintf(buf, len, "%u", id); in nl_proto_n2a()
640 if (nl_proto_tab[id]) in nl_proto_n2a()
641 return nl_proto_tab[id]; in nl_proto_n2a()
643 snprintf(buf, len, "%u", id); in nl_proto_n2a()
647 int nl_proto_a2n(__u32 *id, const char *arg) in nl_proto_a2n() argument
655 *id = res; in nl_proto_a2n()
667 *id = res; in nl_proto_a2n()
675 *id = res; in nl_proto_a2n()