本文整理汇总了C++中rtnl_link_unregister函数的典型用法代码示例。如果您正苦于以下问题:C++ rtnl_link_unregister函数的具体用法?C++ rtnl_link_unregister怎么用?C++ rtnl_link_unregister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtnl_link_unregister函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vti_fini
static void __exit vti_fini(void)
{
rtnl_link_unregister(&vti_link_ops);
xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH);
xfrm4_protocol_deregister(&vti_esp4_protocol, IPPROTO_ESP);
unregister_pernet_device(&vti_net_ops);
}
示例2: ipip_fini
static void __exit ipip_fini(void)
{
rtnl_link_unregister(&ipip_link_ops);
if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET))
pr_info("%s: can't deregister tunnel\n", __func__);
unregister_pernet_device(&ipip_net_ops);
}
示例3: ipip_fini
static void __exit ipip_fini(void)
{
rtnl_link_unregister(&ipip_link_ops);
if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET))
pr_info("%s: can't deregister tunnel\n", __func__);
#if IS_ENABLED(CONFIG_MPLS)
if (xfrm4_tunnel_deregister(&mplsip_handler, AF_MPLS))
pr_info("%s: can't deregister tunnel\n", __func__);
#endif
unregister_pernet_device(&ipip_net_ops);
}
示例4: vhost_netlink_exit
static void
vhost_netlink_exit(void)
{
if (vhost_drv_inited) {
rtnl_link_unregister(&vhost_link_ops);
}
vhost_drv_inited = false;
return;
}
示例5: vti_fini
static void __exit vti_fini(void)
{
rtnl_link_unregister(&vti_link_ops);
if (xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP))
pr_info("vti close: can't deregister tunnel\n");
if (xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH))
pr_info("vti close: can't deregister tunnel\n");
if (xfrm4_protocol_deregister(&vti_esp4_protocol, IPPROTO_ESP))
pr_info("vti close: can't deregister tunnel\n");
unregister_pernet_device(&vti_net_ops);
}
示例6: deth_exit
static __exit void deth_exit(void)
{
struct net* net;
struct deth_net* dn;
for_each_net(net)
{
dn = net_generic(net, deth_net_id);
netlink_kernel_release(dn->nl_sk);
}
unregister_pernet_subsys(&deth_net_ops);
rtnl_link_unregister(&deth_link_ops);
}
示例7: ovs_internal_dev_rtnl_link_register
int ovs_internal_dev_rtnl_link_register(void)
{
int err;
err = rtnl_link_register(&internal_dev_link_ops);
if (err < 0)
return err;
err = ovs_vport_ops_register(&ovs_internal_vport_ops);
if (err < 0)
rtnl_link_unregister(&internal_dev_link_ops);
return err;
}
示例8: micveth_exit_int
static void
micveth_exit_int(void)
{
mic_ctx_t *mic_ctx = kmalloc(sizeof(mic_ctx_t), GFP_KERNEL);
micveth_info_t *veth_info;
ring_packet_t *packet;
int bd;
int idx;
rtnl_link_unregister(&micveth_link_ops);
for (bd = 0; bd < micveth.lv_num_clients; bd++) {
veth_info = &micveth.lv_info[bd];
/* veth_info->mic_ctx == mic_data.dd_bi[bd] is freed in
remove so cannot be used in exit */
mic_ctx->bi_vethinfo = veth_info;
micveth_stop(mic_ctx);
#if WA_UNMAP_AT_RMMOD
mic_ctx_unmap_single(veth_to_ctx(veth_info), veth_info->vi_ring.phys,
sizeof(veth_ring_t));
#endif
for (idx = 0; idx < veth_info->vi_ring.ring.r_tx.rq_length; idx++) {
packet = &veth_info->vi_tx_desc[idx];
if (packet->pd_skb != NULL) {
#if WA_UNMAP_AT_RMMOD
mic_ctx_unmap_single(veth_to_ctx(veth_info), packet->pd_phys,
packet->pd_skb->len);
#endif
kfree_skb(packet->pd_skb);
}
}
for (idx = 0; idx < veth_info->vi_ring.ring.r_rx.rq_length; idx++) {
packet = &veth_info->vi_rx_desc[idx];
#if WA_UNMAP_AT_RMMOD
mic_ctx_unmap_single(veth_to_ctx(veth_info), packet->pd_phys, packet->pd_skb->len);
#endif
kfree_skb(packet->pd_skb);
}
}
kfree(mic_ctx);
kfree(micveth.lv_info);
}
示例9: hsr_netlink_init
int __init hsr_netlink_init(void)
{
int rc;
rc = rtnl_link_register(&hsr_link_ops);
if (rc)
goto fail_rtnl_link_register;
rc = genl_register_family_with_ops_groups(&hsr_genl_family, hsr_ops,
hsr_mcgrps);
if (rc)
goto fail_genl_register_family;
return 0;
fail_genl_register_family:
rtnl_link_unregister(&hsr_link_ops);
fail_rtnl_link_register:
return rc;
}
示例10: imq_init_module
static int __init imq_init_module(void)
{
int err;
#if defined(CONFIG_IMQ_NUM_DEVS)
BUILD_BUG_ON(CONFIG_IMQ_NUM_DEVS > 16);
BUILD_BUG_ON(CONFIG_IMQ_NUM_DEVS < 2);
BUILD_BUG_ON(CONFIG_IMQ_NUM_DEVS - 1 > IMQ_F_IFMASK);
#endif
err = imq_init_devs();
if (err) {
printk(KERN_ERR "IMQ: Error trying imq_init_devs(net)\n");
return err;
}
err = imq_init_hooks();
if (err) {
printk(KERN_ERR "IMQ: Error trying imq_init_hooks()\n");
rtnl_link_unregister(&imq_link_ops);
memset(imq_devs_cache, 0, sizeof(imq_devs_cache));
return err;
}
printk(KERN_INFO "IMQ driver loaded successfully. "
"(numdevs = %d, numqueues = %d)\n", numdevs, numqueues);
#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB)
printk(KERN_INFO "\tHooking IMQ before NAT on PREROUTING.\n");
#else
printk(KERN_INFO "\tHooking IMQ after NAT on PREROUTING.\n");
#endif
#if defined(CONFIG_IMQ_BEHAVIOR_AB) || defined(CONFIG_IMQ_BEHAVIOR_BB)
printk(KERN_INFO "\tHooking IMQ before NAT on POSTROUTING.\n");
#else
printk(KERN_INFO "\tHooking IMQ after NAT on POSTROUTING.\n");
#endif
return 0;
}
示例11: ipgre_init
static int __init ipgre_init(void)
{
int err;
pr_info("GRE over IPv4 tunneling driver\n");
err = register_pernet_device(&ipgre_net_ops);
if (err < 0)
return err;
err = register_pernet_device(&ipgre_tap_net_ops);
if (err < 0)
goto pnet_tap_faied;
err = gre_cisco_register(&ipgre_protocol);
if (err < 0) {
pr_info("%s: can't add protocol\n", __func__);
goto add_proto_failed;
}
err = rtnl_link_register(&ipgre_link_ops);
if (err < 0)
goto rtnl_link_failed;
err = rtnl_link_register(&ipgre_tap_ops);
if (err < 0)
goto tap_ops_failed;
return 0;
tap_ops_failed:
rtnl_link_unregister(&ipgre_link_ops);
rtnl_link_failed:
gre_cisco_unregister(&ipgre_protocol);
add_proto_failed:
unregister_pernet_device(&ipgre_tap_net_ops);
pnet_tap_faied:
unregister_pernet_device(&ipgre_net_ops);
return err;
}
示例12: br_netlink_init
int __init br_netlink_init(void)
{
int err;
err = rtnl_link_register(&br_link_ops);
if (err < 0)
goto err1;
err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL,
br_dump_ifinfo, NULL);
if (err)
goto err2;
err = __rtnl_register(PF_BRIDGE, RTM_SETLINK,
br_rtm_setlink, NULL, NULL);
if (err)
goto err3;
err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH,
br_fdb_add, NULL, NULL);
if (err)
goto err3;
err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH,
br_fdb_delete, NULL, NULL);
if (err)
goto err3;
err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH,
NULL, br_fdb_dump, NULL);
if (err)
goto err3;
return 0;
err3:
rtnl_unregister_all(PF_BRIDGE);
err2:
rtnl_link_unregister(&br_link_ops);
err1:
return err;
}
示例13: ovs_internal_dev_rtnl_link_unregister
void ovs_internal_dev_rtnl_link_unregister(void)
{
ovs_vport_ops_unregister(&ovs_internal_vport_ops);
rtnl_link_unregister(&internal_dev_link_ops);
}
示例14: hsr_netlink_exit
void __exit hsr_netlink_exit(void)
{
genl_unregister_family(&hsr_genl_family);
rtnl_link_unregister(&hsr_link_ops);
}
示例15: br_netlink_fini
void __exit br_netlink_fini(void)
{
rtnl_link_unregister(&br_link_ops);
rtnl_unregister_all(PF_BRIDGE);
}