I want to implement a C program that captures all the Precision-Time-Protocol (PTP) frames on the Ethernet, so I created a raw socket and attached a filter for PTP, I use recvmsg() to read data from the socket. The first issue is that I wasn’t receiving any PTP frames so I commented out the filter but now I am not
Tag: raw-sockets
C socket programming: Set ip header’s id to 0?
I want to send raw IP packets, which works perfectly fine, except for one field in the IP header. I need to set the IP id to 0. I tried it the following way: I then create a RAW_SOCKET with the IP_HDRINCL option set: I then create a buffer, containing my IP header, UDP header and the payload and send
resend packets via RAW sockets in linux
It’s needed to read raw data from one interface and send it via another. open&&config(the same for sock_raw_outer): then in cycle: then, if I catch on sock_raw_inner any packet(arp request, for example), it sended on sock_raw_inner again and again by sendto. What’s wrong? Thanks. Answer Your sock_raw_inner is still listening on every interface because the bind on eth0 you are