-/*
- * Function vlan_proto_init (pro)
- *
- * Initialize VLAN protocol layer,
- *
- */
-static int __init vlan_proto_init(void)
-{
- int err;
-
- pr_info("%s v%s %s\n", vlan_fullname, vlan_version, vlan_copyright);
- pr_info("All bugs added by %s\n", vlan_buggyright);
-
- /* proc file system initialization */
- err = vlan_proc_init();
- if (err < 0) {
- pr_err("%s: can't create entry in proc filesystem!\n",
- __FUNCTION__);
- return err;
- }
-
- dev_add_pack(&vlan_packet_type);
-
- /* Register us to receive netdevice events */
- err = register_netdevice_notifier(&vlan_notifier_block);
- if (err < 0)
- goto err1;
-
- err = vlan_netlink_init();
- if (err < 0)
- goto err2;
-
- vlan_ioctl_set(vlan_ioctl_handler);
- return 0;
-
-err2:
- unregister_netdevice_notifier(&vlan_notifier_block);
-err1:
- vlan_proc_cleanup();
- dev_remove_pack(&vlan_packet_type);
- return err;
-}
-
-/*
- * Module 'remove' entry point.
- * o delete /proc/net/router directory and static entries.
- */
-static void __exit vlan_cleanup_module(void)
-{
- int i;
-
- vlan_ioctl_set(NULL);
- vlan_netlink_fini();
-
- /* Un-register us from receiving netdevice events */
- unregister_netdevice_notifier(&vlan_notifier_block);
-
- dev_remove_pack(&vlan_packet_type);
-
- /* This table must be empty if there are no module
- * references left.
- */
- for (i = 0; i < VLAN_GRP_HASH_SIZE; i++) {
- BUG_ON(!hlist_empty(&vlan_group_hash[i]));
- }
- vlan_proc_cleanup();
-
- synchronize_net();
-}
-
-module_init(vlan_proto_init);
-module_exit(vlan_cleanup_module);
-