This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Source interface


On Tue, Feb 18, 2003 at 10:46:21AM +0100, Magnus Ekhall wrote:
> In eCos, I want to find out at which interface (for example: eth0) a message
> received with recvfrom was received.
> Any ideas of how that can be done?

This is a general BSD Sockets question. 

I don't think its possible. At least not using the normal API. When
the packet is passed into the ethernet layer, i think a pointer to the
incoming interface is put into the mbuf. But when the data in the
packet is copied from "kernel" space to "user" space, this is lost. 

Since you have the sources, you could add this functionality. Probably
the easiest would be to cache the m->m_pkthdr.rcvif when doing the
kernel->user space copy. Then add an ioctl call which retrieves the
information from the cache.

            Andrew



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]