Skip to contentSkip to conversation

Header information of the packets

DISCUSSION Yan Li 1 participant 1 message Oct 29, 2002

lore
Share & tools
lore

Yan Li

author
#0 lore raw

Hi all,

I wrote a small program which copy the input packets from the kernel to the userspace using libipq. And the packets are stored in a buffer in userspace which is actually an array, say buf.

Using:
ipq_packet_msg_t * m = ipq_get_packet(buf);

I can access some parameters of the packets like the packet ID, packet length which are defined in the struct ipq_packet_msg_t. For example, m->packet_id points to the packet ID. But how can I get other information of the packets, like the source and destination address, the protocol, etc. Is there any function or should I read different unit of the array, buf, to do that?

I am only a beginner. Many thanks for your kind reply.

Yan