#include <linux/sys.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/unistd.h>
#include <linux/string.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/capability.h>
#include <linux/hrtimer.h>
#include <linux/freezer.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/inet.h>
#include <linux/inetdevice.h>
#include <linux/rtnetlink.h>
#include <linux/if_arp.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/udp.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/wait.h>
#include <linux/etherdevice.h>
#include <linux/kthread.h>
#include <linux/prefetch.h>
#include <net/net_namespace.h>
#include <net/checksum.h>
#include <net/ipv6.h>
#include <net/addrconf.h>
#include <asm/byteorder.h>
#include <linux/rcupdate.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/timex.h>
#include <linux/uaccess.h>
#include <asm/dma.h>
#include <asm/div64.h>
Go to the source code of this file.
|
| module_init (pg_init) |
|
| module_exit (pg_cleanup) |
|
| MODULE_AUTHOR ("Robert Olsson <[email protected]>") |
|
| MODULE_DESCRIPTION ("Packet Generator tool") |
|
| MODULE_LICENSE ("GPL") |
|
| MODULE_VERSION (VERSION) |
|
| module_param (pg_count_d, int, 0) |
|
| MODULE_PARM_DESC (pg_count_d,"Default number of packets to inject") |
|
| module_param (pg_delay_d, int, 0) |
|
| MODULE_PARM_DESC (pg_delay_d,"Default delay between packets (nanoseconds)") |
|
| module_param (pg_clone_skb_d, int, 0) |
|
| MODULE_PARM_DESC (pg_clone_skb_d,"Default number of copies of the same packet") |
|
| module_param (debug, int, 0) |
|
| MODULE_PARM_DESC (debug,"Enable debugging of pktgen module") |
|
#define F_FLOW_SEQ (1<<11) /* Sequential flows */ |
#define F_IPDST_RND (1<<1) /* IP-Dst Random */ |
#define F_IPSEC_ON (1<<12) /* ipsec on for flows */ |
#define F_IPSRC_RND (1<<0) /* IP-Src Random */ |
#define F_MACDST_RND (1<<5) /* MAC-Dst Random */ |
#define F_MACSRC_RND (1<<4) /* MAC-Src Random */ |
#define F_MPLS_RND (1<<8) /* Random MPLS labels */ |
#define F_QUEUE_MAP_RND (1<<13) /* queue map Random */ |
#define F_SVID_RND (1<<10) /* Random SVLAN ID */ |
#define F_UDPDST_RND (1<<3) /* UDP-Dst Random */ |
#define F_UDPSRC_RND (1<<2) /* UDP-Src Random */ |
#define F_VID_RND (1<<9) /* Random VLAN ID */ |
#define func_enter |
( |
| ) |
pr_debug("entering %s\n", __func__); |
#define if_lock |
( |
|
t | ) |
spin_lock(&(t->if_lock)); |
#define if_unlock |
( |
|
t | ) |
spin_unlock(&(t->if_lock)); |
#define MPLS_STACK_BOTTOM htonl(0x00000100) |
#define PG_PROC_DIR "pktgen" |
#define PKTGEN_MAGIC 0xbe9be955 |
#define pr_fmt |
( |
|
fmt | ) |
KBUILD_MODNAME ": " fmt |
#define SVLAN_TAG_SIZE |
( |
|
x | ) |
((x)->svlan_id == 0xffff ? 0 : 4) |
#define T_REMDEV (1<<3) /* Remove one dev */ |
#define T_REMDEVALL (1<<2) /* Remove all devs */ |
#define T_STOP (1<<0) /* Stop run */ |
#define VLAN_TAG_SIZE |
( |
|
x | ) |
((x)->vlan_id == 0xffff ? 0 : 4) |
MODULE_DESCRIPTION |
( |
"Packet Generator tool" |
| ) |
|
module_exit |
( |
pg_cleanup |
| ) |
|
module_param |
( |
pg_count_d |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
module_param |
( |
pg_delay_d |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
module_param |
( |
pg_clone_skb_d |
, |
|
|
int |
, |
|
|
0 |
|
|
) |
| |
MODULE_PARM_DESC |
( |
pg_count_d |
, |
|
|
"Default number of packets to inject" |
|
|
) |
| |
MODULE_PARM_DESC |
( |
pg_delay_d |
, |
|
|
"Default delay between packets (nanoseconds)" |
|
|
) |
| |
MODULE_PARM_DESC |
( |
pg_clone_skb_d |
, |
|
|
"Default number of copies of the same packet" |
|
|
) |
| |
MODULE_PARM_DESC |
( |
debug |
, |
|
|
"Enable debugging of pktgen module" |
|
|
) |
| |