Lines Matching refs:netdev
211 static NetDev *netdev_free(NetDev *netdev) { in netdev_free() argument
212 if (!netdev) in netdev_free()
215 free(netdev->ifname); in netdev_free()
216 free(netdev->kind); in netdev_free()
217 return mfree(netdev); in netdev_free()
223 _cleanup_(netdev_freep) NetDev *netdev = NULL; in netdev_new()
240 netdev = new(NetDev, 1); in netdev_new()
241 if (!netdev) in netdev_new()
244 *netdev = (NetDev) { in netdev_new()
249 r = hashmap_ensure_put(&context->netdevs_by_name, &string_hash_ops, netdev->ifname, netdev); in netdev_new()
254 *ret = netdev; in netdev_new()
256 TAKE_PTR(netdev); in netdev_new()
807 NetDev *netdev; in parse_cmdline_vlan() local
819 netdev = netdev_get(context, name); in parse_cmdline_vlan()
820 if (!netdev) { in parse_cmdline_vlan()
821 r = netdev_new(context, "vlan", name, &netdev); in parse_cmdline_vlan()
831 NetDev *netdev; in parse_cmdline_bridge() local
843 netdev = netdev_get(context, name); in parse_cmdline_bridge()
844 if (!netdev) { in parse_cmdline_bridge()
845 r = netdev_new(context, "bridge", name, &netdev); in parse_cmdline_bridge()
869 NetDev *netdev; in parse_cmdline_bond() local
881 netdev = netdev_get(context, name); in parse_cmdline_bond()
882 if (!netdev) { in parse_cmdline_bond()
883 r = netdev_new(context, "bond", name, &netdev); in parse_cmdline_bond()
921 return parse_mtu(AF_UNSPEC, p + 1, &netdev->mtu); in parse_cmdline_bond()
1182 void netdev_dump(NetDev *netdev, FILE *f) { in netdev_dump() argument
1183 assert(netdev); in netdev_dump()
1190 netdev->kind, in netdev_dump()
1191 netdev->ifname); in netdev_dump()
1193 if (netdev->mtu > 0) in netdev_dump()
1194 fprintf(f, "MTUBytes=%" PRIu32 "\n", netdev->mtu); in netdev_dump()
1257 int netdev_format(NetDev *netdev, char **ret) { in netdev_format() argument
1262 assert(netdev); in netdev_format()
1272 netdev_dump(netdev, f); in netdev_format()