~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/in.h

Version: ~ [ linux-5.16 ] ~ [ linux-5.15.13 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.90 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.170 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.224 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.261 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.296 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.298 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/in.h (Version linux-4.7.10) and /include/linux/in.h (Version unix-v6-master)


  1 /*                                                  1 
  2  * INET         An implementation of the TCP/I    
  3  *              operating system.  INET is imp    
  4  *              interface as the means of comm    
  5  *                                                
  6  *              Definitions of the Internet Pr    
  7  *                                                
  8  * Version:     @(#)in.h        1.0.1   04/21/    
  9  *                                                
 10  * Authors:     Original taken from the GNU Pr    
 11  *              Fred N. van Kempen, <waltje@uW    
 12  *                                                
 13  *              This program is free software;    
 14  *              modify it under the terms of t    
 15  *              as published by the Free Softw    
 16  *              2 of the License, or (at your     
 17  */                                               
 18 #ifndef _LINUX_IN_H                               
 19 #define _LINUX_IN_H                               
 20                                                   
 21                                                   
 22 #include <linux/errno.h>                          
 23 #include <uapi/linux/in.h>                        
 24                                                   
 25 static inline int proto_ports_offset(int proto    
 26 {                                                 
 27         switch (proto) {                          
 28         case IPPROTO_TCP:                         
 29         case IPPROTO_UDP:                         
 30         case IPPROTO_DCCP:                        
 31         case IPPROTO_ESP:       /* SPI */         
 32         case IPPROTO_SCTP:                        
 33         case IPPROTO_UDPLITE:                     
 34                 return 0;                         
 35         case IPPROTO_AH:        /* SPI */         
 36                 return 4;                         
 37         default:                                  
 38                 return -EINVAL;                   
 39         }                                         
 40 }                                                 
 41                                                   
 42 static inline bool ipv4_is_loopback(__be32 add    
 43 {                                                 
 44         return (addr & htonl(0xff000000)) == h    
 45 }                                                 
 46                                                   
 47 static inline bool ipv4_is_multicast(__be32 ad    
 48 {                                                 
 49         return (addr & htonl(0xf0000000)) == h    
 50 }                                                 
 51                                                   
 52 static inline bool ipv4_is_local_multicast(__b    
 53 {                                                 
 54         return (addr & htonl(0xffffff00)) == h    
 55 }                                                 
 56                                                   
 57 static inline bool ipv4_is_lbcast(__be32 addr)    
 58 {                                                 
 59         /* limited broadcast */                   
 60         return addr == htonl(INADDR_BROADCAST)    
 61 }                                                 
 62                                                   
 63 static inline bool ipv4_is_zeronet(__be32 addr    
 64 {                                                 
 65         return (addr & htonl(0xff000000)) == h    
 66 }                                                 
 67                                                   
 68 /* Special-Use IPv4 Addresses (RFC3330) */        
 69                                                   
 70 static inline bool ipv4_is_private_10(__be32 a    
 71 {                                                 
 72         return (addr & htonl(0xff000000)) == h    
 73 }                                                 
 74                                                   
 75 static inline bool ipv4_is_private_172(__be32     
 76 {                                                 
 77         return (addr & htonl(0xfff00000)) == h    
 78 }                                                 
 79                                                   
 80 static inline bool ipv4_is_private_192(__be32     
 81 {                                                 
 82         return (addr & htonl(0xffff0000)) == h    
 83 }                                                 
 84                                                   
 85 static inline bool ipv4_is_linklocal_169(__be3    
 86 {                                                 
 87         return (addr & htonl(0xffff0000)) == h    
 88 }                                                 
 89                                                   
 90 static inline bool ipv4_is_anycast_6to4(__be32    
 91 {                                                 
 92         return (addr & htonl(0xffffff00)) == h    
 93 }                                                 
 94                                                   
 95 static inline bool ipv4_is_test_192(__be32 add    
 96 {                                                 
 97         return (addr & htonl(0xffffff00)) == h    
 98 }                                                 
 99                                                   
100 static inline bool ipv4_is_test_198(__be32 add    
101 {                                                 
102         return (addr & htonl(0xfffe0000)) == h    
103 }                                                 
104 #endif  /* _LINUX_IN_H */                         
105                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp