Skip to contentSkip to conversation

move proc init to newly created net/ipv4/ip_proc.c

PATCH In review Arnaldo Carvalho de Melo 2 participants 3 messages Oct 12, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 move proc init to newly created net/ipv4/ip_proc.c

David,

Please consider pulling from:

master.kernel.org:/home/acme/BK/ip-2.5

- Arnaldo

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================

[email protected], 2002-10-11 20:49:08-03:00, [email protected]
[ipv4] move proc init to newly created net/ipv4/ip_proc.c

This is the start of the seq_file work, so that I can see if anybody will cough too much on the choosen path...

Also convert some unneeded __constat_htons to plain htons, that results in the same code being generated.

 include/net/ip.h   |    8 +++---
 net/ipv4/Makefile  |    2 -
 net/ipv4/af_inet.c |   20 +--------------
 net/ipv4/ip_proc.c |   70 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 78 insertions(+), 22 deletions(-)
include/net/ip.h +5 -3
diff -Nru a/include/net/ip.h b/include/net/ip.h
@@ -174,7 +174,7 @@
 int ip_decrease_ttl(struct iphdr *iph)
 {
 	u32 check = iph->check;
-	check += __constant_htons(0x0100);
+	check += htons(0x0100);
 	iph->check = check + (check>=0xFFFF);
 	return --iph->ttl;
 }
@@ -191,7 +191,7 @@
 
 static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, struct sock *sk)
 {
-	if (iph->frag_off&__constant_htons(IP_DF)) {
+	if (iph->frag_off & htons(IP_DF)) {
 		/* This is only to work around buggy Windows95/2000
 		 * VJ compression implementations.  If the ID field
 		 * does not change, they drop every other packet in
@@ -205,7 +205,7 @@
 
 static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more)
 {
-	if (iph->frag_off&__constant_htons(IP_DF)) {
+	if (iph->frag_off & htons(IP_DF)) {
 		if (sk && inet_sk(sk)->daddr) {
 			iph->id = htons(inet_sk(sk)->id);
 			inet_sk(sk)->id += 1 + more;
@@ -279,5 +279,7 @@
 			      u16 port, u32 info, u8 *payload);
 extern void	ip_local_error(struct sock *sk, int err, u32 daddr, u16 dport,
 			       u32 info);
+
+extern int ipv4_proc_init(void);
 
 #endif	/* _IP_H */
net/ipv4/Makefile +1 -1
diff -Nru a/net/ipv4/Makefile b/net/ipv4/Makefile
@@ -4,7 +4,7 @@
 
 obj-y     := utils.o route.o inetpeer.o proc.o protocol.o \
 	     ip_input.o ip_fragment.o ip_forward.o ip_options.o \
-	     ip_output.o ip_sockglue.o \
+	     ip_output.o ip_sockglue.o ip_proc.o \
 	     tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o tcp_minisocks.o \
 	     tcp_diag.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \
 	     sysctl_net_ipv4.o fib_frontend.o fib_semantics.o fib_hash.o
net/ipv4/af_inet.c +2 -18
diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
@@ -82,7 +82,6 @@
 #include <linux/fcntl.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
-#include <linux/proc_fs.h>
 #include <linux/stat.h>
 #include <linux/init.h>
 #include <linux/poll.h>
@@ -124,12 +123,6 @@
 atomic_t inet_sock_nr;
 #endif
 
-extern int raw_get_info(char *, char **, off_t, int);
-extern int snmp_get_info(char *, char **, off_t, int);
-extern int netstat_get_info(char *, char **, off_t, int);
-extern int afinet_get_info(char *, char **, off_t, int);
-extern int tcp_get_info(char *, char **, off_t, int);
-extern int udp_get_info(char *, char **, off_t, int);
 extern void ip_mc_drop_socket(struct sock *sk);
 
 #ifdef CONFIG_DLCI
@@ -1211,17 +1204,8 @@
 	ip_mr_init();
 #endif
 
-	/*
-	 *	Create all the /proc entries.
-	 */
-#ifdef CONFIG_PROC_FS
-	proc_net_create ("raw", 0, raw_get_info);
-	proc_net_create ("netstat", 0, netstat_get_info);
-	proc_net_create ("snmp", 0, snmp_get_info);
-	proc_net_create ("sockstat", 0, afinet_get_info);
-	proc_net_create ("tcp", 0, tcp_get_info);
-	proc_net_create ("udp", 0, udp_get_info);
-#endif		/* CONFIG_PROC_FS */
+	ipv4_proc_init();
 	return 0;
 }
+
 module_init(inet_init);
net/ipv4/ip_proc.c new file +70 -0

70 lines not on this page · raw message

===================================================================

This BitKeeper patch contains the following changesets:
1.735
## Wrapped with gzip_uu ##

begin 664 bkpatch8730 M'XL(`"=NIST``^U9[4_;2!/_G/TKYKE*)^@19]?O"4?5%DJ?J"U%T#XZZ>DI M<NQU;&%[??8:BIK[WV]V[01"0RC15?U2B/#NSNPO\[8SL^8)?*QY->H%8<[) M$_BOJ.6H%XJ"AS*]#(Q0Y,:T0L*9$$@8)"+G@Y=O!FG9-PV'(.$TD&$"E[RJ M1SUF6,L5>5WR4>_LU>N/;U^<$7)P(=)4,SX.9=P<$"DJ"Z#+*J?!S+)1&'( M*BCJG$O]E?,EZ]RDU,1?AWD6==PY<ZGMS4,6,1;8C$?4M'W7OD$K>3%KTLUP MC-(A\QV;N7-JF;Y'CH9GN4-0>,#A@#DX[LX8CZ?6J-*5EF^=W;0*_V="G MY"7\NYH<DA#^GY:7]I^0BTL.925"2(M4XO=P:^R:P@K'D@>X4P.%"?^F2@V M(\2]^/F0I#7@1R8<:AE4$D3<3OA?DSC-.%R)ZF(/:H&K@80QA$&!1YI#$%Q M/171-<)<I5D&H6AFZ$LA(&_0J:+00&$B1,T+*%%EPS#:KWV1(2!:"4-!(G;. MH2D*SB.4=#+!=11%3A*)Z5*F05I7JZUXI1\;K)9$V4NJVX6*$(N(PY6DQ M@QDO>*4T-\@;8+;IF^3T)JA(_Y$_A-"DF?KO3O_VKA=[##&7,>QK#FE'KHQ M]$W?MYS8-RW7FIK.EG"VB@??0G$VAU-:A%D3\4&+9R2WHVIH^W.'.98S=V+; M8YY#/=MT/'=JWR/46CEDFG9GN7-38]1YT&1EJJ]"RZX"J\5F1Q_;CK,M^<^ MBQQN38<^L\S8M\.'#+6"=DLHU_3PF'RS4$$\27'2V7M%*I1D[KDL<AU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R-HHTN(B,'#_/5B^.:2^XU$'NW7+L77KX:[>9+V1Y6UN/1SH M6S]OLC_H)MO>LNYT9G>=O45?=L0\#UN_<?OHA0D/+^"W@U;2'?J9,DKQC!VQ MH:W9]$/GG[1,^L_B*IA-L(KK]V.\>GDZ'AW%[Z0(PP[M:5]?-.6L>EC,*Z6 M]75'<G_U"K6X!#Y\TK:\A9*+('TN2V9435+UL3'L3T68-+D1\?L@/728[S"+ MS5WFF]W;H\>>.9]]O/$_:`3U[Y"N.\NM/#V-D=.'SA]W$#]H'&Q2)6--(0:
MJ_HYRQK>SK39!7Q:C?CE"X9'A/PCWW&L+R_WON+`$F/9MF/.'2PPK@YWDSXV MWDV,=_]GP/^H@-<OI^X+^*7#MXEXW\%H/V*F!ZYZ,"PBJIB89EM-5E,\IG=% =<I'TZ>9_![HRU4U^@+W/T(^&/OD'I86%A)48````
`
end

#1 lore raw

From: Arnaldo Carvalho de Melo <[email protected]>
Date: Fri, 11 Oct 2002 22:06:49 -0300

Please consider pulling from:

master.kernel.org:/home/acme/BK/ip-2.5

Pulled, thanks.

#2 lore raw

Em Fri, Oct 11, 2002 at 06:26:14PM -0700, David S. Miller escreveu:

Quoted 8 lines

From: Arnaldo Carvalho de Melo <[email protected]>
Date: Fri, 11 Oct 2002 22:06:49 -0300

Please consider pulling from:

   master.kernel.org:/home/acme/BK/ip-2.5

Pulled, thanks.

Thanks, I'm working now on net/ipv4/arp.c.

- Arnaldo