1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 #ifndef __SEQ_FILE_NET_H__ 3 #define __SEQ_FILE_NET_H__ 4 5 #include <linux/seq_file.h> 6 #include <net/net_trackers.h> 7 8 struct net; 9 extern struct net init_net; 10 11 struct seq_net_private { 12 #ifdef CONFIG_NET_NS 13 struct net *net; 14 netns_tracker ns_tracker; 15 #endif 16 }; 17 18 static inline struct net *seq_file_net(struct 19 { 20 #ifdef CONFIG_NET_NS 21 return ((struct seq_net_private *)seq- 22 #else 23 return &init_net; 24 #endif 25 } 26 27 /* 28 * This one is needed for proc_create_net_sing 29 * in private not as a struct i.e. seq_file_ne 30 */ 31 static inline struct net *seq_file_single_net( 32 { 33 #ifdef CONFIG_NET_NS 34 return (struct net *)seq->private; 35 #else 36 return &init_net; 37 #endif 38 } 39 40 #endif 41
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.