[Olsr-dev] Sending packets through olsrd flooding mechanism.. [HOW?]
Gianni Costanzi
(spam-protected)
Mon Sep 3 17:21:02 CEST 2007
Would it be correct to do the following steps for sending a new kind of
messages with message ID ABC?
Implement
serialize_abc(struct interface *ifp)
{
[...]
m = (union olsr_message *)msg_buffer;
// Set the all the parameters of the m->v4 except the m->v4.message (since it
// is a union with the known messages' data structures... we want a new
// message)
m->v4.hopcnt = 0;
m->v4.ttl = MAX_TTL;
m->v4.olsr_msgtype = ABC_MESSAGE;
m->v4.olsr_vtime = ? // I've not yet looked at how it is used
// Add our message's data starting from (void*)&m->v4->message, doing the
// proper checks on the outbuffer of ifp, as serialize_hna does, dividing the
// information in multiple messages if necessary etc..
[...]
m->v4.seqno = htons(get_msg_seqno());
m->v4.olsr_msgsize = htons(curr_size);
net_outbuffer_push(ifp, msg_buffer, curr_size);
}
The fact that &m->v4.message does not point to one of the known-messages' data
structures should not be a problem for the forwarding mechanism, since it
simply needs a correct olsr_msgsize to copy the message into a new packet,
right?
Then, is it sufficient for me to register into the packet parser a
"not-forwarding" function for the ABC_MESSAGE type of messages? Again,
there should be no problems since my message will be corerctly
forwarded as an unknown message type, is it correct?
I hope I've been quite clear..
Bye,
Gianni
On 9/3/07, Gianni Costanzi <(spam-protected)> wrote:
> Hi,
> I'd like to be able to send broadcast packets from my olsrd plug-in to
> the same plug-in running on the other nodes of the olsrd-network.. For
> the packet reception and forwarding part, I think I have understood
> what to do: I should register a function into the packet parser,
> saying that the function processes packets of MY_OWN_TYPE and does not
> forward the packet, in order to use the default MPR-optimized
> flooding.. right?
>
> I'm a bit more confused when I must deal with the sending of packets..
> how should I build a packet of my own type and how should I flood it
> into the net? Do I need to send it on each olsrd interface or does
> olsrd provide function like flood_packet_into_the_net which takes care
> of sending it on the oslrd interfaces ecc? Can you tell me which
> functions should I use? I do not need full details on what to do, just
> some indications, in order to be able to understand what to do by
> reading olsrd code..
>
> Thank you in advance for any help,
> Gianni
>
> --
> --------------------------------------------------------------------------------------------------------------
> | Gianni Costanzi ((spam-protected))
> | (http://utenti.lycos.it/giannicostanzi/)
> |
> | Gentoo Documentation Project (GDP) Member - Italian Translator
> | (http://www.gentoo.org/proj/en/gdp/)
> |
> | Free Software Foundation Member #3844 (www.fsf.org)
> | "Free Software is a matter of Liberty not price"
> |
> | Sun Valley in Rock Staff Member (www.sunvalleyinrock.net/forum)
> --------------------------------------------------------------------------------------------------------------
>
--
--------------------------------------------------------------------------------------------------------------
| Gianni Costanzi ((spam-protected))
| (http://utenti.lycos.it/giannicostanzi/)
|
| Gentoo Documentation Project (GDP) Member - Italian Translator
| (http://www.gentoo.org/proj/en/gdp/)
|
| Free Software Foundation Member #3844 (www.fsf.org)
| "Free Software is a matter of Liberty not price"
|
| Sun Valley in Rock Staff Member (www.sunvalleyinrock.net/forum)
--------------------------------------------------------------------------------------------------------------
More information about the Olsr-dev
mailing list