Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[VxWorks] How to send arp broadcast packet on vxworks?

366 views
Skip to first unread message

Yao Yong

unread,
Aug 14, 2003, 10:35:27 PM8/14/03
to
Hi, all
I want to know how to send arp broadcast packet on vxworks. In
if_ether.c, I found a function as the following:
/*
* Broadcast an ARP request. Caller specifies:
* - arp header source ip address
* - arp header target ip address
* - arp header source ethernet address
*/
static void
arprequest(ac, sip, tip, enaddr)
register struct arpcom *ac;
register u_long *sip, *tip;
register u_char *enaddr;
It seems that it can handle the problem. But I can't find some
type definition which is used in the function.
Hope for your help.

Best regards

Pete Flugstad

unread,
Aug 19, 2003, 4:27:49 PM8/19/03
to

If you are just trying to "take over" an IP address, you can simply
do an ifAddrSet or ifAddrAdd - this will automatically broadcast an
ARP packet mapping the IP address to the NIC's MAC.

If you are trying to resolve an IP address, you probably want to use
etherAddrResolve (part of the etherLib package).

The above function is defined static, so it may not be accessible to
you anyway. The struct arpccom is defined in netinet/if_ether.h.

Hope this helps.

Pete
--
Pete Flugstad
Remove NO.SPAM to reply directly
Icon Labs (http://www.icon-labs.com)

Yao Yong

unread,
Aug 19, 2003, 9:19:16 PM8/19/03
to
Pete Flugstad <pete.fl...@SPAMicon-labs.com> wrote in message news:<3F4288...@SPAMicon-labs.com>...

Thanks for your help.
What I want to do is to send an arp packet on an interface with a
specified ip address and mac address. It just likes an arp proxy.

Yusuf Motiwala

unread,
Aug 22, 2003, 12:43:58 AM8/22/03
to
ARP is very simple protocol. I suggest to form an ARP packet and send it
over ethernet interface. Probably, this is simple and efficient way to do
it.

Regards,
Yusuf

"Yao Yong" <yy_un...@hotmail.com> wrote in message
news:cfe430d0.03081...@posting.google.com...

msafar

unread,
Aug 22, 2003, 3:43:40 PM8/22/03
to
Could you be more specific, wha are you trying to achieve?
I think Pete gave you good hints - you want to send arp broadcast -
etherAddrResolve.

One more thought:
If you want to act as an gateway to others try to play with routing
tables. If your IP address is known to the rest of the hosts as an
gateway to some other subnets, they will send you the packets
automatically. If you setup your routing tables correctly too, the
existing send operations will resolve the addresses you want to reach
for you, without writing a line of code. Is this what you are doing?

msafar


yy_un...@hotmail.com (Yao Yong) wrote in message news:<cfe430d0.03081...@posting.google.com>...

0 new messages