I am writing a kernel module which creates a IP packet. Now i want to send this packet but haven't created any socket for it's transmission.
is there any way to send it directly with the help of kernel routines.
as i have tracked the linux kernel code for packet transmission there is a function defined in net/core/dev.c named as dev_hard_start_xmit(). can we use it?
Actually i don't want to use sockets.
You don't need a socket to send a UDP packet in kernel, you just need to allocate an skb, and construct the IP header and UDP header by yourself, and finally send it out by dev_queue_xmit().