Operating System - HP-UX
1751695 Members
4856 Online
108781 Solutions
New Discussion юеВ

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

 
jacky823
New Member

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 3
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
New Member

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