Re: [RTnet-developers] Raw Socket
Brought to you by:
bet-frogger,
kiszka
|
From: Jorge A. <j-a...@cr...> - 2006-08-30 16:59:25
|
OK Jan.
I will try to make the B solution to work and if any doubt i ask in the list.
Regarding the SSH frames i don't need they in the socket (I think !!!).
Em Quarta, 30 de Agosto de 2006 17:48, o Jan Kiszka escreveu:
> [put the list on CC again]
>
> Jorge Almeida wrote:
> > For my application i need the RAW socket catching all the messages in the network, and then they are treated in the rest of the application.
> >
> > But i have a smaller application, a watchdog, that have a UDP socket for remote control of the first application.
> > And one of the principles is that they must stay independent from each other, i mean without communication.
> >
> > And not very often i yould like to connect to the machine using a ssh client for log collector or maybe a maintenance operation for example.
>
> SSH would either be tunnelled (when using a closed, RTmac-managed
> network) or be forwarded to the rtnetproxy (when installed). But do you
> need those packets on the ETH_P_ALL socket as well?
>
> >
> > For that to work i think the A solution is not enough (!!!????)
>
> Do you need ANY incoming packet delivered to more than one socket? If
> yes, A is a no-go. :(
>
> >
> > But maybe the B 1 solution, with copy, is enough.
>
> Ok, let's go for this and optimise later (shared rtskbs).
>
> >
> > But i stuck in the rtskb copy, because i dont know all the architectur and concept of the rtskb.
> > If anyone could help me with the rtskb_copy function.
> >
> > I've started with this:
> > alloc a rtskb from the rtskb_queue (this is the queue from the socket that gonna red the message after) so this rtskb will be release shortly.
> > But now i dont know if a can make a simple memcpy copying the all structure at once or i need to make some more complicated kind of copy.
> > After the copy the result rtskb will be inserted in the head of the driver receiving queue and willbe acquired by the socket function to the socket queue as normaly,
> > with this the same function is used for ETH_P_ALL or any other protocol.
> >
> > // int rtskb_copy(struct rtskb *rtskb_1,struct rtskb *rtskb_2,struct rtskb_queue *pool)
> > // {
> > //
> > // rtskb_1 = alloc_rtskb(rtskb_2->len,pool);
> > // if(rtskb_1 = NULL)
> > // return -ENOMEM;
> > //
> > //
> > //
> > //
> > // }
> >
>
> memcpy the data, but not the control structure. I would suggest to
> carefully step through the short life of an rtskb from its allocation in
> the driver's rx handler up to the point where you want to clone it (BTW,
> "clone" is the better term for the future, copy is just the current way
> to achieve this). What fields are touched? What do they express?
> =>Translate. If you stumble of some fields of an rtskb that you don't
> understand, come back and ask here.
>
> Jan
>
>
--
Jorge Almeida
j-a...@cr...
DISCLAIMER: This message may contain confidential information or privileged material and is intended only for the individual(s) named. If you are not a named addressee and mistakenly received this message you should not copy or otherwise disseminate it: please delete this e-mail from your system and notify the sender immediately. E-mail transmissions are not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. Therefore, the sender does not accept liability for any errors or omissions in the contents of this message that arise as a result of e-mail transmissions. Please request a hard copy version if verification is required. Critical Software, SA.
|