Re: [mpls-linux-general] How to do it?
Status: Beta
Brought to you by:
jleu
From: James R. L. <jl...@mi...> - 2002-01-17 15:27:11
|
Hello, On Thu, Jan 17, 2002 at 07:49:55PM +0800, =D5=C5=CE=B0=D2=BB wrote: > Hi ALL, > In the README in mpls-linux-1.0\patches,Jim wrote "if you also add sup= port for the /proc filesystem the result will be four new files in the /p= roc/net directory".I have run "mplsadm" successfully.But I do not find th= ose files in /proc/net.How can I add suppot for /proc filesystem? > There are mpls_*.c in /usr/src/linux/net/mpls.I do not clear that how = those codes called by mplsadm? (I know using those files we can generate = the mpls.o,but in the Makefile in mpls-linux-1.0/utils,we do not use the = mpls.o) How does the mplsadm implement the MPLS forwarding for the Linux = Kernel? > I wanna your help,thanks.:) Since the MPLS forwarding plane is in the kernel and 'mplsadm' runs as a userland process, their are a few mechanisms availble for transfering information between the two: - /proc/sys/* - system calls ('ioctl' 'fnctl' etc..) - netlink Currently I use a mix of system calls and netlink (although I'm leaning m= ore to using less and less netlink). If you look in the patched kernel source you can look at the two files th= at are the entry points for netlink and ioctl calls: net/mpls/mpls_ioctl.c net/mpls/mpls_netlink.c. Both of these files end up calling functions in differnt files (mpls_tunnel.c mpls_in_info.c mpls_out_info.c etc). What all this about /proc? MPLS for linux uses the proc filesystem as a way of exposing to the user what is currently configured, they are read only "files". The reason I quoted "files" is that they are not file= s in the traditional sense. Everything in the /proc filesystem is actually a set of virtual files that result in kernel functions being called whenv= er they are accessed. If you look in net/mpls/mpls_proc.c you will see the functions that produce the output that you see when looking at /proc/net/= mpls_* I hope this helps. Jim > =20 > Yours Sincerely >=20 > Zhang Weiyi >=20 >=20 >=20 >=20 >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > http://dating.163.com =B4=BA=CC=EC=BB=A8=BB=E1=BF=AA=A3=AC=C4=D0=BA= =A2=C5=AE=BA=A2=D2=AA=C1=B5=B0=AE=A1=AB > http://im.163.com =CD=F8=D2=D7=B6=CC=D0=C5=CD=A8=A3=BA=C3=E2=B7= =D1=B7=A2=CB=CD=CA=D6=BB=FA=B6=CC=D0=C5=B5=C4=D7=C0=C3=E6=C8=ED=BC=FE > http://vip.163.com =CD=F8=D2=D7VIP=D3=CA=CF=E4 30=C3=EB=C1=A2=B5= =C3 >=20 > _______________________________________________ > mpls-linux-general mailing list > mpl...@li... > https://lists.sourceforge.net/lists/listinfo/mpls-linux-general --=20 James R. Leu |