Lines Matching refs:link

184 static void release_link_info(struct rtnl_link *link)  in release_link_info()  argument
186 struct rtnl_link_info_ops *io = link->l_info_ops; in release_link_info()
190 io->io_free(link); in release_link_info()
191 link->l_info_ops = NULL; in release_link_info()
197 struct rtnl_link *link = nl_object_priv(c); in link_free_data() local
199 if (link) { in link_free_data()
202 if ((io = link->l_info_ops) != NULL) in link_free_data()
203 release_link_info(link); in link_free_data()
205 nl_addr_put(link->l_addr); in link_free_data()
206 nl_addr_put(link->l_bcast); in link_free_data()
259 struct rtnl_link *link; in link_msg_parser() local
264 link = rtnl_link_alloc(); in link_msg_parser()
265 if (link == NULL) { in link_msg_parser()
270 link->ce_msgtype = n->nlmsg_type; in link_msg_parser()
281 nla_strlcpy(link->l_name, tb[IFLA_IFNAME], IFNAMSIZ); in link_msg_parser()
284 link->l_family = ifi->ifi_family; in link_msg_parser()
285 link->l_arptype = ifi->ifi_type; in link_msg_parser()
286 link->l_index = ifi->ifi_index; in link_msg_parser()
287 link->l_flags = ifi->ifi_flags; in link_msg_parser()
288 link->l_change = ifi->ifi_change; in link_msg_parser()
289 link->ce_mask = (LINK_ATTR_IFNAME | LINK_ATTR_FAMILY | in link_msg_parser()
296 link->l_stats[RTNL_LINK_RX_PACKETS] = st->rx_packets; in link_msg_parser()
297 link->l_stats[RTNL_LINK_RX_BYTES] = st->rx_bytes; in link_msg_parser()
298 link->l_stats[RTNL_LINK_RX_ERRORS] = st->rx_errors; in link_msg_parser()
299 link->l_stats[RTNL_LINK_RX_DROPPED] = st->rx_dropped; in link_msg_parser()
300 link->l_stats[RTNL_LINK_RX_COMPRESSED] = st->rx_compressed; in link_msg_parser()
301 link->l_stats[RTNL_LINK_RX_FIFO_ERR] = st->rx_fifo_errors; in link_msg_parser()
302 link->l_stats[RTNL_LINK_TX_PACKETS] = st->tx_packets; in link_msg_parser()
303 link->l_stats[RTNL_LINK_TX_BYTES] = st->tx_bytes; in link_msg_parser()
304 link->l_stats[RTNL_LINK_TX_ERRORS] = st->tx_errors; in link_msg_parser()
305 link->l_stats[RTNL_LINK_TX_DROPPED] = st->tx_dropped; in link_msg_parser()
306 link->l_stats[RTNL_LINK_TX_COMPRESSED] = st->tx_compressed; in link_msg_parser()
307 link->l_stats[RTNL_LINK_TX_FIFO_ERR] = st->tx_fifo_errors; in link_msg_parser()
308 link->l_stats[RTNL_LINK_RX_LEN_ERR] = st->rx_length_errors; in link_msg_parser()
309 link->l_stats[RTNL_LINK_RX_OVER_ERR] = st->rx_over_errors; in link_msg_parser()
310 link->l_stats[RTNL_LINK_RX_CRC_ERR] = st->rx_crc_errors; in link_msg_parser()
311 link->l_stats[RTNL_LINK_RX_FRAME_ERR] = st->rx_frame_errors; in link_msg_parser()
312 link->l_stats[RTNL_LINK_RX_MISSED_ERR] = st->rx_missed_errors; in link_msg_parser()
313 link->l_stats[RTNL_LINK_TX_ABORT_ERR] = st->tx_aborted_errors; in link_msg_parser()
314 link->l_stats[RTNL_LINK_TX_CARRIER_ERR] = st->tx_carrier_errors; in link_msg_parser()
315 link->l_stats[RTNL_LINK_TX_HBEAT_ERR] = st->tx_heartbeat_errors; in link_msg_parser()
316 link->l_stats[RTNL_LINK_TX_WIN_ERR] = st->tx_window_errors; in link_msg_parser()
317 link->l_stats[RTNL_LINK_MULTICAST] = st->multicast; in link_msg_parser()
319 link->ce_mask |= LINK_ATTR_STATS; in link_msg_parser()
323 link->l_txqlen = nla_get_u32(tb[IFLA_TXQLEN]); in link_msg_parser()
324 link->ce_mask |= LINK_ATTR_TXQLEN; in link_msg_parser()
328 link->l_mtu = nla_get_u32(tb[IFLA_MTU]); in link_msg_parser()
329 link->ce_mask |= LINK_ATTR_MTU; in link_msg_parser()
333 link->l_addr = nl_addr_alloc_attr(tb[IFLA_ADDRESS], AF_UNSPEC); in link_msg_parser()
334 if (link->l_addr == NULL) { in link_msg_parser()
338 nl_addr_set_family(link->l_addr, in link_msg_parser()
339 nl_addr_guess_family(link->l_addr)); in link_msg_parser()
340 link->ce_mask |= LINK_ATTR_ADDR; in link_msg_parser()
344 link->l_bcast = nl_addr_alloc_attr(tb[IFLA_BROADCAST], in link_msg_parser()
346 if (link->l_bcast == NULL) { in link_msg_parser()
350 nl_addr_set_family(link->l_bcast, in link_msg_parser()
351 nl_addr_guess_family(link->l_bcast)); in link_msg_parser()
352 link->ce_mask |= LINK_ATTR_BRD; in link_msg_parser()
356 link->l_link = nla_get_u32(tb[IFLA_LINK]); in link_msg_parser()
357 link->ce_mask |= LINK_ATTR_LINK; in link_msg_parser()
361 link->l_weight = nla_get_u32(tb[IFLA_WEIGHT]); in link_msg_parser()
362 link->ce_mask |= LINK_ATTR_WEIGHT; in link_msg_parser()
366 nla_strlcpy(link->l_qdisc, tb[IFLA_QDISC], IFQDISCSIZ); in link_msg_parser()
367 link->ce_mask |= LINK_ATTR_QDISC; in link_msg_parser()
371 nla_memcpy(&link->l_map, tb[IFLA_MAP], in link_msg_parser()
373 link->ce_mask |= LINK_ATTR_MAP; in link_msg_parser()
377 link->l_master = nla_get_u32(tb[IFLA_MASTER]); in link_msg_parser()
378 link->ce_mask |= LINK_ATTR_MASTER; in link_msg_parser()
382 link->l_operstate = nla_get_u8(tb[IFLA_OPERSTATE]); in link_msg_parser()
383 link->ce_mask |= LINK_ATTR_OPERSTATE; in link_msg_parser()
387 link->l_linkmode = nla_get_u8(tb[IFLA_LINKMODE]); in link_msg_parser()
388 link->ce_mask |= LINK_ATTR_LINKMODE; in link_msg_parser()
408 link->l_info_ops = ops; in link_msg_parser()
409 err = ops->io_parse(link, li[IFLA_INFO_DATA], in link_msg_parser()
419 err = pp->pp_cb((struct nl_object *) link, pp); in link_msg_parser()
421 rtnl_link_put(link); in link_msg_parser()
434 struct rtnl_link *link = (struct rtnl_link *) obj; in link_dump_line() local
436 nl_dump_line(p, "%s %s ", link->l_name, in link_dump_line()
437 nl_llproto2str(link->l_arptype, buf, sizeof(buf))); in link_dump_line()
439 if (link->l_addr && !nl_addr_iszero(link->l_addr)) in link_dump_line()
440 nl_dump(p, "%s ", nl_addr2str(link->l_addr, buf, sizeof(buf))); in link_dump_line()
442 if (link->ce_mask & LINK_ATTR_MASTER) { in link_dump_line()
443 struct rtnl_link *master = rtnl_link_get(cache, link->l_master); in link_dump_line()
449 rtnl_link_flags2str(link->l_flags, buf, sizeof(buf)); in link_dump_line()
453 if (link->ce_mask & LINK_ATTR_LINK) { in link_dump_line()
454 struct rtnl_link *ll = rtnl_link_get(cache, link->l_link); in link_dump_line()
460 if (link->l_info_ops && link->l_info_ops->io_dump[NL_DUMP_LINE]) in link_dump_line()
461 link->l_info_ops->io_dump[NL_DUMP_LINE](link, p); in link_dump_line()
468 struct rtnl_link *link = (struct rtnl_link *) obj; in link_dump_details() local
473 nl_dump_line(p, " mtu %u ", link->l_mtu); in link_dump_details()
474 nl_dump(p, "txqlen %u weight %u ", link->l_txqlen, link->l_weight); in link_dump_details()
476 if (link->ce_mask & LINK_ATTR_QDISC) in link_dump_details()
477 nl_dump(p, "qdisc %s ", link->l_qdisc); in link_dump_details()
479 if (link->ce_mask & LINK_ATTR_MAP && link->l_map.lm_irq) in link_dump_details()
480 nl_dump(p, "irq %u ", link->l_map.lm_irq); in link_dump_details()
482 if (link->ce_mask & LINK_ATTR_IFINDEX) in link_dump_details()
483 nl_dump(p, "index %u ", link->l_index); in link_dump_details()
489 if (link->ce_mask & LINK_ATTR_BRD) in link_dump_details()
490 nl_dump(p, "brd %s ", nl_addr2str(link->l_bcast, buf, in link_dump_details()
493 if ((link->ce_mask & LINK_ATTR_OPERSTATE) && in link_dump_details()
494 link->l_operstate != IF_OPER_UNKNOWN) { in link_dump_details()
495 rtnl_link_operstate2str(link->l_operstate, buf, sizeof(buf)); in link_dump_details()
500 rtnl_link_mode2str(link->l_linkmode, buf, sizeof(buf))); in link_dump_details()
502 if (link->l_info_ops && link->l_info_ops->io_dump[NL_DUMP_DETAILS]) in link_dump_details()
503 link->l_info_ops->io_dump[NL_DUMP_DETAILS](link, p); in link_dump_details()
508 struct rtnl_link *link = (struct rtnl_link *) obj; in link_dump_stats() local
517 res = nl_cancel_down_bytes(link->l_stats[RTNL_LINK_RX_BYTES], &unit); in link_dump_stats()
523 link->l_stats[RTNL_LINK_RX_PACKETS], in link_dump_stats()
524 link->l_stats[RTNL_LINK_RX_ERRORS], in link_dump_stats()
525 link->l_stats[RTNL_LINK_RX_DROPPED], in link_dump_stats()
526 link->l_stats[RTNL_LINK_RX_FIFO_ERR], in link_dump_stats()
527 link->l_stats[RTNL_LINK_RX_COMPRESSED]); in link_dump_stats()
529 res = nl_cancel_down_bytes(link->l_stats[RTNL_LINK_TX_BYTES], &unit); in link_dump_stats()
535 link->l_stats[RTNL_LINK_TX_PACKETS], in link_dump_stats()
536 link->l_stats[RTNL_LINK_TX_ERRORS], in link_dump_stats()
537 link->l_stats[RTNL_LINK_TX_DROPPED], in link_dump_stats()
538 link->l_stats[RTNL_LINK_TX_FIFO_ERR], in link_dump_stats()
539 link->l_stats[RTNL_LINK_TX_COMPRESSED]); in link_dump_stats()
547 link->l_stats[RTNL_LINK_RX_LEN_ERR], in link_dump_stats()
548 link->l_stats[RTNL_LINK_RX_OVER_ERR], in link_dump_stats()
549 link->l_stats[RTNL_LINK_RX_CRC_ERR], in link_dump_stats()
550 link->l_stats[RTNL_LINK_RX_FRAME_ERR], in link_dump_stats()
551 link->l_stats[RTNL_LINK_RX_MISSED_ERR], in link_dump_stats()
552 link->l_stats[RTNL_LINK_MULTICAST]); in link_dump_stats()
559 link->l_stats[RTNL_LINK_TX_ABORT_ERR], in link_dump_stats()
560 link->l_stats[RTNL_LINK_TX_CARRIER_ERR], in link_dump_stats()
561 link->l_stats[RTNL_LINK_TX_HBEAT_ERR], in link_dump_stats()
562 link->l_stats[RTNL_LINK_TX_WIN_ERR], in link_dump_stats()
563 link->l_stats[RTNL_LINK_TX_COLLISIONS]); in link_dump_stats()
565 if (link->l_info_ops && link->l_info_ops->io_dump[NL_DUMP_STATS]) in link_dump_stats()
566 link->l_info_ops->io_dump[NL_DUMP_STATS](link, p); in link_dump_stats()
571 struct rtnl_link *link = (struct rtnl_link *) obj; in link_dump_env() local
576 nl_dump_line(p, "LINK_NAME=%s\n", link->l_name); in link_dump_env()
577 nl_dump_line(p, "LINK_IFINDEX=%u\n", link->l_index); in link_dump_env()
579 nl_af2str(link->l_family, buf, sizeof(buf))); in link_dump_env()
581 nl_llproto2str(link->l_arptype, buf, sizeof(buf))); in link_dump_env()
582 if (link->ce_mask & LINK_ATTR_ADDR) in link_dump_env()
584 nl_addr2str(link->l_addr, buf, sizeof(buf))); in link_dump_env()
585 nl_dump_line(p, "LINK_MTU=%u\n", link->l_mtu); in link_dump_env()
586 nl_dump_line(p, "LINK_TXQUEUELEN=%u\n", link->l_txqlen); in link_dump_env()
587 nl_dump_line(p, "LINK_WEIGHT=%u\n", link->l_weight); in link_dump_env()
589 rtnl_link_flags2str(link->l_flags & ~IFF_RUNNING, buf, sizeof(buf)); in link_dump_env()
593 if (link->ce_mask & LINK_ATTR_QDISC) in link_dump_env()
594 nl_dump_line(p, "LINK_QDISC=%s\n", link->l_qdisc); in link_dump_env()
596 if (link->ce_mask & LINK_ATTR_LINK) { in link_dump_env()
597 struct rtnl_link *ll = rtnl_link_get(cache, link->l_link); in link_dump_env()
599 nl_dump_line(p, "LINK_LINK_IFINDEX=%d\n", link->l_link); in link_dump_env()
606 if (link->ce_mask & LINK_ATTR_MASTER) { in link_dump_env()
607 struct rtnl_link *master = rtnl_link_get(cache, link->l_master); in link_dump_env()
614 if (link->ce_mask & LINK_ATTR_BRD) in link_dump_env()
616 nl_addr2str(link->l_bcast, buf, sizeof(buf))); in link_dump_env()
618 if (link->ce_mask & LINK_ATTR_STATS) { in link_dump_env()
628 nl_dump_line(p, "%s=%" PRIu64 "\n", buf, link->l_stats[i]); in link_dump_env()
632 if (link->l_info_ops && link->l_info_ops->io_dump[NL_DUMP_ENV]) in link_dump_env()
633 link->l_info_ops->io_dump[NL_DUMP_ENV](link, p); in link_dump_env()
718 __ADD(LINK_ATTR_LINK, link)
753 void rtnl_link_put(struct rtnl_link *link) in rtnl_link_put() argument
755 nl_object_put((struct nl_object *) link); in rtnl_link_put()
793 struct rtnl_link *link; in rtnl_link_get() local
798 nl_list_for_each_entry(link, &cache->c_items, ce_list) { in rtnl_link_get()
799 if (link->l_index == ifindex) { in rtnl_link_get()
800 nl_object_get((struct nl_object *) link); in rtnl_link_get()
801 return link; in rtnl_link_get()
821 struct rtnl_link *link; in rtnl_link_get_by_name() local
826 nl_list_for_each_entry(link, &cache->c_items, ce_list) { in rtnl_link_get_by_name()
827 if (!strcmp(name, link->l_name)) { in rtnl_link_get_by_name()
828 nl_object_get((struct nl_object *) link); in rtnl_link_get_by_name()
829 return link; in rtnl_link_get_by_name()
984 struct rtnl_link *link = rtnl_link_get(cache, ifindex); in rtnl_link_i2name() local
986 if (link) { in rtnl_link_i2name()
987 strncpy(dst, link->l_name, len - 1); in rtnl_link_i2name()
988 rtnl_link_put(link); in rtnl_link_i2name()
1005 struct rtnl_link *link; in rtnl_link_name2i() local
1007 link = rtnl_link_get_by_name(cache, name); in rtnl_link_name2i()
1008 if (link) { in rtnl_link_name2i()
1009 ifindex = link->l_index; in rtnl_link_name2i()
1010 rtnl_link_put(link); in rtnl_link_name2i()
1157 void rtnl_link_set_qdisc(struct rtnl_link *link, const char *qdisc) in rtnl_link_set_qdisc() argument
1159 strncpy(link->l_qdisc, qdisc, sizeof(link->l_qdisc) - 1); in rtnl_link_set_qdisc()
1160 link->ce_mask |= LINK_ATTR_QDISC; in rtnl_link_set_qdisc()
1163 char *rtnl_link_get_qdisc(struct rtnl_link *link) in rtnl_link_get_qdisc() argument
1165 if (link->ce_mask & LINK_ATTR_QDISC) in rtnl_link_get_qdisc()
1166 return link->l_qdisc; in rtnl_link_get_qdisc()
1171 void rtnl_link_set_name(struct rtnl_link *link, const char *name) in rtnl_link_set_name() argument
1173 strncpy(link->l_name, name, sizeof(link->l_name) - 1); in rtnl_link_set_name()
1174 link->ce_mask |= LINK_ATTR_IFNAME; in rtnl_link_set_name()
1177 char *rtnl_link_get_name(struct rtnl_link *link) in rtnl_link_get_name() argument
1179 if (link->ce_mask & LINK_ATTR_IFNAME) in rtnl_link_get_name()
1180 return link->l_name; in rtnl_link_get_name()
1185 static inline void __assign_addr(struct rtnl_link *link, struct nl_addr **pos, in __assign_addr() argument
1194 link->ce_mask |= flag; in __assign_addr()
1197 void rtnl_link_set_addr(struct rtnl_link *link, struct nl_addr *addr) in rtnl_link_set_addr() argument
1199 __assign_addr(link, &link->l_addr, addr, LINK_ATTR_ADDR); in rtnl_link_set_addr()
1202 struct nl_addr *rtnl_link_get_addr(struct rtnl_link *link) in rtnl_link_get_addr() argument
1204 if (link->ce_mask & LINK_ATTR_ADDR) in rtnl_link_get_addr()
1205 return link->l_addr; in rtnl_link_get_addr()
1210 void rtnl_link_set_broadcast(struct rtnl_link *link, struct nl_addr *brd) in rtnl_link_set_broadcast() argument
1212 __assign_addr(link, &link->l_bcast, brd, LINK_ATTR_BRD); in rtnl_link_set_broadcast()
1215 struct nl_addr *rtnl_link_get_broadcast(struct rtnl_link *link) in rtnl_link_get_broadcast() argument
1217 if (link->ce_mask & LINK_ATTR_BRD) in rtnl_link_get_broadcast()
1218 return link->l_bcast; in rtnl_link_get_broadcast()
1223 void rtnl_link_set_flags(struct rtnl_link *link, unsigned int flags) in rtnl_link_set_flags() argument
1225 link->l_flag_mask |= flags; in rtnl_link_set_flags()
1226 link->l_flags |= flags; in rtnl_link_set_flags()
1227 link->ce_mask |= LINK_ATTR_FLAGS; in rtnl_link_set_flags()
1230 void rtnl_link_unset_flags(struct rtnl_link *link, unsigned int flags) in rtnl_link_unset_flags() argument
1232 link->l_flag_mask |= flags; in rtnl_link_unset_flags()
1233 link->l_flags &= ~flags; in rtnl_link_unset_flags()
1234 link->ce_mask |= LINK_ATTR_FLAGS; in rtnl_link_unset_flags()
1237 unsigned int rtnl_link_get_flags(struct rtnl_link *link) in rtnl_link_get_flags() argument
1239 return link->l_flags; in rtnl_link_get_flags()
1242 void rtnl_link_set_family(struct rtnl_link *link, int family) in rtnl_link_set_family() argument
1244 link->l_family = family; in rtnl_link_set_family()
1245 link->ce_mask |= LINK_ATTR_FAMILY; in rtnl_link_set_family()
1248 int rtnl_link_get_family(struct rtnl_link *link) in rtnl_link_get_family() argument
1250 if (link->l_family & LINK_ATTR_FAMILY) in rtnl_link_get_family()
1251 return link->l_family; in rtnl_link_get_family()
1256 void rtnl_link_set_arptype(struct rtnl_link *link, unsigned int arptype) in rtnl_link_set_arptype() argument
1258 link->l_arptype = arptype; in rtnl_link_set_arptype()
1261 unsigned int rtnl_link_get_arptype(struct rtnl_link *link) in rtnl_link_get_arptype() argument
1263 return link->l_arptype; in rtnl_link_get_arptype()
1266 void rtnl_link_set_ifindex(struct rtnl_link *link, int ifindex) in rtnl_link_set_ifindex() argument
1268 link->l_index = ifindex; in rtnl_link_set_ifindex()
1269 link->ce_mask |= LINK_ATTR_IFINDEX; in rtnl_link_set_ifindex()
1272 int rtnl_link_get_ifindex(struct rtnl_link *link) in rtnl_link_get_ifindex() argument
1274 return link->l_index; in rtnl_link_get_ifindex()
1277 void rtnl_link_set_mtu(struct rtnl_link *link, unsigned int mtu) in rtnl_link_set_mtu() argument
1279 link->l_mtu = mtu; in rtnl_link_set_mtu()
1280 link->ce_mask |= LINK_ATTR_MTU; in rtnl_link_set_mtu()
1283 unsigned int rtnl_link_get_mtu(struct rtnl_link *link) in rtnl_link_get_mtu() argument
1285 if (link->ce_mask & LINK_ATTR_MTU) in rtnl_link_get_mtu()
1286 return link->l_mtu; in rtnl_link_get_mtu()
1291 void rtnl_link_set_txqlen(struct rtnl_link *link, unsigned int txqlen) in rtnl_link_set_txqlen() argument
1293 link->l_txqlen = txqlen; in rtnl_link_set_txqlen()
1294 link->ce_mask |= LINK_ATTR_TXQLEN; in rtnl_link_set_txqlen()
1297 unsigned int rtnl_link_get_txqlen(struct rtnl_link *link) in rtnl_link_get_txqlen() argument
1299 if (link->ce_mask & LINK_ATTR_TXQLEN) in rtnl_link_get_txqlen()
1300 return link->l_txqlen; in rtnl_link_get_txqlen()
1305 void rtnl_link_set_weight(struct rtnl_link *link, unsigned int weight) in rtnl_link_set_weight() argument
1307 link->l_weight = weight; in rtnl_link_set_weight()
1308 link->ce_mask |= LINK_ATTR_WEIGHT; in rtnl_link_set_weight()
1311 unsigned int rtnl_link_get_weight(struct rtnl_link *link) in rtnl_link_get_weight() argument
1313 if (link->ce_mask & LINK_ATTR_WEIGHT) in rtnl_link_get_weight()
1314 return link->l_weight; in rtnl_link_get_weight()
1319 void rtnl_link_set_link(struct rtnl_link *link, int ifindex) in rtnl_link_set_link() argument
1321 link->l_link = ifindex; in rtnl_link_set_link()
1322 link->ce_mask |= LINK_ATTR_LINK; in rtnl_link_set_link()
1325 int rtnl_link_get_link(struct rtnl_link *link) in rtnl_link_get_link() argument
1327 return link->l_link; in rtnl_link_get_link()
1330 void rtnl_link_set_master(struct rtnl_link *link, int ifindex) in rtnl_link_set_master() argument
1332 link->l_master = ifindex; in rtnl_link_set_master()
1333 link->ce_mask |= LINK_ATTR_MASTER; in rtnl_link_set_master()
1336 int rtnl_link_get_master(struct rtnl_link *link) in rtnl_link_get_master() argument
1338 return link->l_master; in rtnl_link_get_master()
1341 void rtnl_link_set_operstate(struct rtnl_link *link, uint8_t operstate) in rtnl_link_set_operstate() argument
1343 link->l_operstate = operstate; in rtnl_link_set_operstate()
1344 link->ce_mask |= LINK_ATTR_OPERSTATE; in rtnl_link_set_operstate()
1347 uint8_t rtnl_link_get_operstate(struct rtnl_link *link) in rtnl_link_get_operstate() argument
1349 if (link->ce_mask & LINK_ATTR_OPERSTATE) in rtnl_link_get_operstate()
1350 return link->l_operstate; in rtnl_link_get_operstate()
1355 void rtnl_link_set_linkmode(struct rtnl_link *link, uint8_t linkmode) in rtnl_link_set_linkmode() argument
1357 link->l_linkmode = linkmode; in rtnl_link_set_linkmode()
1358 link->ce_mask |= LINK_ATTR_LINKMODE; in rtnl_link_set_linkmode()
1361 uint8_t rtnl_link_get_linkmode(struct rtnl_link *link) in rtnl_link_get_linkmode() argument
1363 if (link->ce_mask & LINK_ATTR_LINKMODE) in rtnl_link_get_linkmode()
1364 return link->l_linkmode; in rtnl_link_get_linkmode()
1369 uint64_t rtnl_link_get_stat(struct rtnl_link *link, int id) in rtnl_link_get_stat() argument
1374 return link->l_stats[id]; in rtnl_link_get_stat()
1388 int rtnl_link_set_info_type(struct rtnl_link *link, const char *type) in rtnl_link_set_info_type() argument
1396 if (link->l_info_ops) in rtnl_link_set_info_type()
1397 release_link_info(link); in rtnl_link_set_info_type()
1399 if ((err = io->io_alloc(link)) < 0) in rtnl_link_set_info_type()
1402 link->l_info_ops = io; in rtnl_link_set_info_type()
1414 char *rtnl_link_get_info_type(struct rtnl_link *link) in rtnl_link_get_info_type() argument
1416 if (link->l_info_ops) in rtnl_link_get_info_type()
1417 return link->l_info_ops->io_name; in rtnl_link_get_info_type()