#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

/*
Demonstrates creating a netfilter kernel module on Linux (not Mac or Windows).  This module does not 
do anything other than print that it loaded and was moved.  Notice it uses printk, not printf!

Author: Tim Pierson, Dartmouth CS60, Fall 2026
		based on an example from "Internet Security: A hands-on approach" by Wenliang Du

Compile:
        make

Insert module into kernel:
        sudo insmod kMod.ko //module name in Makefile

Check that kernel module is loaded:
        lsmod | grep kMod

Remove module from kernel:
        sudo rmmod kMod
*/

static int kmodule_init(void) {
        printk(KERN_INFO "Initializing this module\n");
        return 0;
}

static void kmodule_exit(void) {
        printk(KERN_INFO "Module cleanup\n");
}

module_init(kmodule_init);       
module_exit(kmodule_exit);      

MODULE_LICENSE("GPL");