Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use raw socket to capture packets on HP-UX 11.23?

jacky823
Occasional Visitor

Can I use raw socket to capture packets on HP-UX 11.23?

Hi
I hope to capture packets on net card.I try to use raw socket to do it. But it can't return any BYTES.
sockd = socket(AF_INET,SOCK_RAW,);
recvfrom(sockd,buf,BUF_SIZE,0,0,&d);
The thread suspend in recvfrom and can't return any words.
Can you tell me how can I capture packets in program?
3 REPLIES
rick jones
Honored Contributor

Re: Can I use raw socket to capture packets on HP-UX 11.23?

You need to install and use libpcap.
there is no rest for the wicked yet the virtuous have no pillows
jacky823
Occasional Visitor

Re: Can I use raw socket to capture packets on HP-UX 11.23?

Hi rick:
Do you think we can't receive all packages on netcard with RAW SOCKET on HP-UX? I hnow we can do it on linux.
rick jones
Honored Contributor

Re: Can I use raw socket to capture packets on HP-UX 11.23?

HP-UX and Linux are different operating systems. Sometimes there is more to porting than just a recompile :)

If you want to capture the traffic arriving/departing a network interface, on HP-UX you use DLPI and promiscuous mode. Libpcap provides a higher-level abstraction so you do not have to know about DLPI.
there is no rest for the wicked yet the virtuous have no pillows