Lines Matching refs:id
33 unsigned int id;
48 int id;
55 if (sscanf(p, "0x%x %s\n", &id, namebuf) != 2 &&
56 sscanf(p, "0x%x %s #", &id, namebuf) != 2 &&
57 sscanf(p, "%d %s\n", &id, namebuf) != 2 &&
58 sscanf(p, "%d %s #", &id, namebuf) != 2) {
65 if (id<0)
68 entry->id = id;
70 entry->next = hash[id & (size - 1)];
71 hash[id & (size - 1)] = entry;
86 int id;
93 if (sscanf(p, "0x%x %s\n", &id, namebuf) != 2 &&
94 sscanf(p, "0x%x %s #", &id, namebuf) != 2 &&
95 sscanf(p, "%d %s\n", &id, namebuf) != 2 &&
96 sscanf(p, "%d %s #", &id, namebuf) != 2) {
103 if (id<0 || id>size)
106 tab[id] = strdup(namebuf);
140 char * rtnl_rtprot_n2a(int id, char *buf, int len)
142 if (id<0 || id>=256) {
143 snprintf(buf, len, "%d", id);
146 if (!rtnl_rtprot_tab[id]) {
150 if (rtnl_rtprot_tab[id])
151 return rtnl_rtprot_tab[id];
152 snprintf(buf, len, "%d", id);
156 int rtnl_rtprot_a2n(__u32 *id, char *arg)
164 *id = res;
176 *id = res;
184 *id = res;
207 char * rtnl_rtscope_n2a(int id, char *buf, int len)
209 if (id<0 || id>=256) {
210 snprintf(buf, len, "%d", id);
213 if (!rtnl_rtscope_tab[id]) {
217 if (rtnl_rtscope_tab[id])
218 return rtnl_rtscope_tab[id];
219 snprintf(buf, len, "%d", id);
223 int rtnl_rtscope_a2n(__u32 *id, char *arg)
231 *id = res;
243 *id = res;
251 *id = res;
270 char * rtnl_rtrealm_n2a(int id, char *buf, int len)
272 if (id<0 || id>=256) {
273 snprintf(buf, len, "%d", id);
276 if (!rtnl_rtrealm_tab[id]) {
280 if (rtnl_rtrealm_tab[id])
281 return rtnl_rtrealm_tab[id];
282 snprintf(buf, len, "%d", id);
287 int rtnl_rtrealm_a2n(__u32 *id, char *arg)
295 *id = res;
307 *id = res;
315 *id = res;
320 static struct rtnl_hash_entry dflt_table_entry = { .id = 253, .name = "default" };
321 static struct rtnl_hash_entry main_table_entry = { .id = 254, .name = "main" };
322 static struct rtnl_hash_entry local_table_entry = { .id = 255, .name = "local" };
339 char * rtnl_rttable_n2a(__u32 id, char *buf, int len)
343 if (id > RT_TABLE_MAX) {
344 snprintf(buf, len, "%u", id);
349 entry = rtnl_rttable_hash[id & 255];
350 while (entry && entry->id != id)
354 snprintf(buf, len, "%u", id);
358 int rtnl_rttable_a2n(__u32 *id, char *arg)
367 *id = res;
380 res = entry->id;
381 *id = res;
389 *id = i;
407 char * rtnl_dsfield_n2a(int id, char *buf, int len)
409 if (id<0 || id>=256) {
410 snprintf(buf, len, "%d", id);
413 if (!rtnl_rtdsfield_tab[id]) {
417 if (rtnl_rtdsfield_tab[id])
418 return rtnl_rtdsfield_tab[id];
419 snprintf(buf, len, "0x%02x", id);
424 int rtnl_dsfield_a2n(__u32 *id, char *arg)
432 *id = res;
444 *id = res;
452 *id = res;
457 static struct rtnl_hash_entry dflt_group_entry = { .id = 0, .name = "default" };
472 int rtnl_group_a2n(int *id, char *arg)
481 *id = res;
494 res = entry->id;
495 *id = res;
503 *id = i;