Re: [mpls-linux-general] I need some help to read the codes related with MPLS patches
Status: Beta
Brought to you by:
jleu
From: James R. L. <jl...@mi...> - 2001-11-19 15:31:34
|
You're already using the best document there is, the code. Keep digging through it, you'll figure it out. If you run into a road block, and have specific questions feel free to e-mail that list with it. I or someone else will answer. Jim On Mon, Nov 19, 2001 at 11:58:51PM +0900, =C1=A4=B1=E2=BF=B5 wrote: > I've looked at the code, and i think that the binding point of mpls_out= put() 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=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 o= f 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_M= PLS]. > =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/ >=20 --=20 James R. Leu |