[Olsr-dev] Adding interface argument to packet_transform_function
Hannes Gredler
(spam-protected)
Sat Apr 19 16:08:46 CEST 2008
kelvin,
i am hesitant to commit a infra-change without an actual use
for the community. - unless you provide some code which makes
your infra change obvious i'll not include your patch for once.
/hannes
On Wed, Apr 16, 2008 at 11:21:48AM -0400, Kelvin Tran wrote:
| Hi,
|
| I think it will make the Packet Transform handler a more flexible API
| interface if it provides the interface argument, especially in the
| case where OLSR run on multiple interfaces.
|
| Below is the patch for olsrd-0.5.4 I have created and tested.
| It will be nice if this can be merged into next release.
|
| diff -BurN olsrd-0.5.4_etx/src/net_olsr.h olsrd-0.5.4_l2etx/src/
| net_olsr.h
| --- olsrd-0.5.4_etx/src/net_olsr.h 2007-09-16 17:20:16.000000000
| -0400
| +++ olsrd-0.5.4_l2etx/src/net_olsr.h 2008-02-11 18:51:26.000000000
| -0500
| @@ -50,7 +50,9 @@
| #include <arpa/inet.h>
| #include <net/if.h>
|
| -typedef int (*packet_transform_function)(olsr_u8_t *, int *);
| +/* K.tran 01/08/2008 - Add interface argument to
| packet_transform_function
| + so users know which interface the packet is for */
| +typedef int (*packet_transform_function)(olsr_u8_t *, int *, struct
| interface *);
|
|
| diff -BurN olsrd-0.5.4_etx/src/net_olsr.c olsrd-0.5.4_l2etx/src/
| net_olsr.c
| --- olsrd-0.5.4_etx/src/net_olsr.c 2007-09-16 17:20:16.000000000
| -0400
| +++ olsrd-0.5.4_l2etx/src/net_olsr.c 2008-02-11 17:35:52.000000000
| -0500
| @@ -394,7 +394,7 @@
| */
| for (tmp_ptf_list = ptf_list; tmp_ptf_list != NULL; tmp_ptf_list
| = tmp_ptf_list->next)
| {
| - tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending);
| + tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending,
| ifp);
| }
|
| /*
|
| Thanks,
| /K.tran
|
|
| --
| Olsr-dev mailing list
| (spam-protected)
| http://lists.olsr.org/mailman/listinfo/olsr-dev
|
More information about the Olsr-dev
mailing list