Re: [mpls-linux-general] I need some help to read the codes related with MPLS patches
Status: Beta
Brought to you by:
jleu
From: Olivier D. <Oli...@rd...> - 2001-11-23 11:28:53
|
Hi, Look at document joint. It's an update of the packet journey inside the kernel for MPLS. Hope you this help. Olivier =C1=A4=B1=E2=BF=B5 wrote: >=20 > I've looked at the code, and i think that the binding point of=20 > mpls_output() is in route.c >=20 > After patching mpls codes, in ./net/ipv4/route.c >=20 > 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 > res->proto_data[AUX_PROTO_DATA_MPLS]; > moi =3D res->proto_data[AUX_PROTO_DATA_MPLS]; > mpls_again: > for(i=3D0;imoi_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=20 > MPLS in Linux . > Is there anyone who know this? I hope to learn from him or her. > =20 > Especially, I want to know the semantics of=20 > proto_data[AUX_PROTO_DATA_MPLS]. > =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 > *Your life on the net* > <http://i.dreamwiz.com/dw/ko/n.gif> > = <http://ad.dreamwiz.com/BIN/adc_img.cgi?page=3Dwebdesk_ma_rt3_u&c=3Db>=20 > = <http://ad.dreamwiz.com/BIN/jump.cgi?ad=3Ddwmail_1&page=3Dwebdesk_ma_rt3= _u> > <http://i.dreamwiz.com/dw/ko/n.gif> --=20 FTR&D/DAC/CPN Technopole Anticipa | mailto:Oli...@fr... 2, Avenue Pierre Marzin | Phone: +(33) 2 96 05 28 80 F-22307 LANNION | Fax: +(33) 2 96 05 18 52 |