[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
+ im having a problem with the gethostbyaddr function.
+ i specify the
+ the arguments as :-
+ 127.0.0.1 for the constant character
+ 4 as the size (for ipv4 address),
+ AF_INET for the family.
+ but i get hptr=NULL which is the pointer to the
+ hostent structure.
Well, cant say, but check the error status, which might help you a lot. To
quote from 'man gethostbyaddr'
Error return status from gethostbyname and gethostbyaddr
is indicated by return of a null pointer. The external
integer h_errno may then be checked to see whether this is
a temporary failure or an invalid or unknown host.
+ i am trying to use libpcap (packet capture library)
+ to develop
+ a network analyzer(a modest one of course) and i get
+ following message for pcap_open_live:-
+ /dev/bpf0 not found
Of course you'll have to install the lib first to use it. (Please note,
installing means putting it in some 'standard' location. If you want to
use it w/o installing it, make sure you use correct paths.
On linux, i dont think it uses /dev/bpf0. Its more of socket business, i
suppose, but again, i may be wrong...