public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] raw socket at link layer
@ 2001-07-18  1:51 Weilong Li
  2001-07-18  6:22 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Weilong Li @ 2001-07-18  1:51 UTC (permalink / raw)
  To: ecos-discuss

I am trying to do sniff under ecos.
However, in linux, it eithers give me choice to
use SOCK_PACKET, or use PF_PACKET to make socket
at link layer level,

int fd=socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP));
or
int fd=socket(AF_INET, SOCK_PACKET, htons(ETH_P_IP));

but under ecos's tcp/ip stack,
it neither gives SOCK_PACKET, or PF_PACKET, or
ETH_P_IP, so how to do the sniff?

thanks,

Weilong

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] raw socket at link layer
  2001-07-18  1:51 [ECOS] raw socket at link layer Weilong Li
@ 2001-07-18  6:22 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2001-07-18  6:22 UTC (permalink / raw)
  To: Weilong Li; +Cc: ecos-discuss

On Wed, Jul 18, 2001 at 01:51:40AM -0700, Weilong Li wrote:
> I am trying to do sniff under ecos.
> However, in linux, it eithers give me choice to
> use SOCK_PACKET, or use PF_PACKET to make socket
> at link layer level,
> 
> int fd=socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP));
> or
> int fd=socket(AF_INET, SOCK_PACKET, htons(ETH_P_IP));
> 
> but under ecos's tcp/ip stack,
> it neither gives SOCK_PACKET, or PF_PACKET, or
> ETH_P_IP, so how to do the sniff?

In OpenBSD this is done using the BPF, the Berkley Packet Filter. The
eCos port of the OpenBSD stack does not include the BPF code. So you
first need to add in the BPF code into the eCos stack. Goto
www.openbsd.org for the code you need to intergrate.

        Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-18  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-18  1:51 [ECOS] raw socket at link layer Weilong Li
2001-07-18  6:22 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).