[mpls-linux-general] I need some help to read the codes related with MPLS patches
Status: Beta
Brought to you by:
jleu
|
From: <jj...@dr...> - 2001-11-19 15:06:43
|
I've looked at the code, and i think that the binding point of mpls_outpu=
t() is in route.c
After patching mpls codes, in ./net/ipv4/route.c
void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
{
struct fib_info *fi =3D res->fi;
=20
=A1=A6
=20
#ifdef CONFIG_MPLS
/* JLEU: we need to do this here because both
* ip_route_output_slow() and ip_route_output_slow()
* us this to finish the next hop calculations
*/
if(res->proto_data[AUX_PROTO_DATA_MPLS]) {
struct mpls_out_info *moi;
int i;
=20
MPLS_DEBUG(("rt_set_nexthop: adding label to dst\n"));
MPLS_DEBUG(("rt_set_nexthop: before - mtu =3D %d\n",
rt->u.dst.pmtu));
rt->u.dst.output =3D mpls_output; /* HERE */
rt->u.dst.dst_proto_data[AUX_PROTO_DATA_MPLS] =3D=20
res->proto_data[AUX_PROTO_DATA_MPLS];
moi =3D res->proto_data[AUX_PROTO_DATA_MPLS];
mpls_again:
for(i=3D0;i<moi->moi_instruction_length;i++) {
switch(moi->moi_instruction[i].mi_opcode) {
case MPLS_OP_FWD:
moi =3D (struct mpls_out_info*)
moi->moi_instruction[i].mi_data;
goto mpls_again;
break;
case MPLS_OP_PUSH:
rt->u.dst.pmtu -=3D 4;
break;
}
}
MPLS_DEBUG(("rt_set_nexthop: after - mtu =3D %d\n",
rt->u.dst.pmtu));
}
=20
=A1=A6
=20
}
=20
If res->proto_data[AUX_PROTO_DATA_MPLS] have a value (not zero)
then the output related function is binded with mpls_output()
so the function is invoked.
=20
But I still try to find work that describes the structures or methods of =
MPLS in Linux .=20
Is there anyone who know this? I hope to learn from him or her.
=20
Especially, I want to know the semantics of proto_data[AUX_PROTO_DATA_MPL=
S].
=20
Thanks, in advance.
=20
B.E.
=20
Kiyoung Jung
-------------------------------------------------------
Ki Young Jung (jj...@ic...)
Information and Communications University(ICU)
Broadband Network Laboratory(http://bnlab.icu.ac.kr)
58-4 Hwaam-dong, Yusong-gu, Taejon, 305-732, KOREA
Tel)+82-42-866-6182, 016-370-1751 Fax)+82-42-866-6110=20
-------------------------------------------------------
-------------------------------------------------
DreamWiz Free Mail @ http://www.dreamwiz.com/
DreamSearch Click the world!!! http://search.dreamwiz.com/
|