Re: Can anybody correct this code?



jeniffer wrote:
This is a C program compiled on gcc compiler that tries to set a new
entry in the arp cache,get an entry and also delete an entry from it.I
have run this program but in the set function Set_Entry function a call
to ether_aton(a, n) is made but the value of sa_data is not being
updated.This is why I think tht i am getting the error of invalid
argument in ioctl func..Plzz help me out.

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#include <netinet/if_ether.h>
#include <sys/ioctl.h>

#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
#include <netpacket/packet.h>
#include <net/ethernet.h>
#else
#include <asm/types.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#endif
[snip]

That's enough to determine that you aren't using standard C. You need to post in comp.unix.programmer or possibly a networking group.
.



Relevant Pages