aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-08-04 03:28:28 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-05 16:02:56 -0400
commit49c794e94649020248e37b78db16cd25bad38b4f (patch)
tree76c455522d37fa0fa88c7466bb494523cb320fab /arch
parentc1c00ab8626298ac784ea344bf10e94b5bd9bcb5 (diff)
net: implement a SO_PROTOCOL getsockoption
Similar to SO_TYPE returning the socket type, SO_PROTOCOL allows to retrieve the protocol used with a given socket. I am not quite sure why we have that-many copies of socket.h, and why the values are not the same on all arches either, but for where hex numbers dominate, I use 0x1029 for SO_PROTOCOL as that seems to be the next free unused number across a bunch of operating systems, or so Google results make me want to believe. SO_PROTOCOL for others just uses the next free Linux number, 38. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/socket.h1
-rw-r--r--arch/arm/include/asm/socket.h2
-rw-r--r--arch/avr32/include/asm/socket.h2
-rw-r--r--arch/cris/include/asm/socket.h2
-rw-r--r--arch/frv/include/asm/socket.h2
-rw-r--r--arch/h8300/include/asm/socket.h2
-rw-r--r--arch/ia64/include/asm/socket.h2
-rw-r--r--arch/m32r/include/asm/socket.h2
-rw-r--r--arch/m68k/include/asm/socket.h2
-rw-r--r--arch/microblaze/include/asm/socket.h2
-rw-r--r--arch/mips/include/asm/socket.h1
-rw-r--r--arch/mn10300/include/asm/socket.h2
-rw-r--r--arch/parisc/include/asm/socket.h1
-rw-r--r--arch/powerpc/include/asm/socket.h2
-rw-r--r--arch/s390/include/asm/socket.h2
-rw-r--r--arch/sparc/include/asm/socket.h2
-rw-r--r--arch/x86/include/asm/socket.h2
-rw-r--r--arch/xtensa/include/asm/socket.h2
18 files changed, 33 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
index 3641ec1452f4..2f8b4d377749 100644
--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -32,6 +32,7 @@
32#define SO_RCVTIMEO 0x1012 32#define SO_RCVTIMEO 0x1012
33#define SO_SNDTIMEO 0x1013 33#define SO_SNDTIMEO 0x1013
34#define SO_ACCEPTCONN 0x1014 34#define SO_ACCEPTCONN 0x1014
35#define SO_PROTOCOL 0x1028
35 36
36/* linux-specific, might as well be the same as on i386 */ 37/* linux-specific, might as well be the same as on i386 */
37#define SO_NO_CHECK 11 38#define SO_NO_CHECK 11
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
index 537de4e0ef50..7f47454ffbf3 100644
--- a/arch/arm/include/asm/socket.h
+++ b/arch/arm/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_SOCKET_H */ 62#endif /* _ASM_SOCKET_H */
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h
index 04c860619700..6af2866a4f00 100644
--- a/arch/avr32/include/asm/socket.h
+++ b/arch/avr32/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* __ASM_AVR32_SOCKET_H */ 62#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h
index d5cf74005408..f3859fb0990c 100644
--- a/arch/cris/include/asm/socket.h
+++ b/arch/cris/include/asm/socket.h
@@ -59,6 +59,8 @@
59#define SO_TIMESTAMPING 37 59#define SO_TIMESTAMPING 37
60#define SCM_TIMESTAMPING SO_TIMESTAMPING 60#define SCM_TIMESTAMPING SO_TIMESTAMPING
61 61
62#define SO_PROTOCOL 38
63
62#endif /* _ASM_SOCKET_H */ 64#endif /* _ASM_SOCKET_H */
63 65
64 66
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h
index 57c3d4054e8b..8dab3486ffa4 100644
--- a/arch/frv/include/asm/socket.h
+++ b/arch/frv/include/asm/socket.h
@@ -57,5 +57,7 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_SOCKET_H */ 62#endif /* _ASM_SOCKET_H */
61 63
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h
index 602518a70a1a..ba770d09cd63 100644
--- a/arch/h8300/include/asm/socket.h
+++ b/arch/h8300/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_SOCKET_H */ 62#endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index 745421225ec6..091cd9d47d0f 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -66,4 +66,6 @@
66#define SO_TIMESTAMPING 37 66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING 67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68 68
69#define SO_PROTOCOL 38
70
69#endif /* _ASM_IA64_SOCKET_H */ 71#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h
index be7ed589af5c..d36f5928fb79 100644
--- a/arch/m32r/include/asm/socket.h
+++ b/arch/m32r/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_M32R_SOCKET_H */ 62#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h
index ca87f938b03f..060cb7ed024f 100644
--- a/arch/m68k/include/asm/socket.h
+++ b/arch/m68k/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_SOCKET_H */ 62#endif /* _ASM_SOCKET_H */
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h
index 825936860314..96bf8bfa935e 100644
--- a/arch/microblaze/include/asm/socket.h
+++ b/arch/microblaze/include/asm/socket.h
@@ -66,4 +66,6 @@
66#define SO_TIMESTAMPING 37 66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING 67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68 68
69#define SO_PROTOCOL 38
70
69#endif /* _ASM_MICROBLAZE_SOCKET_H */ 71#endif /* _ASM_MICROBLAZE_SOCKET_H */
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index 2abca1780169..289ce5f5f2a3 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -42,6 +42,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
42#define SO_SNDTIMEO 0x1005 /* send timeout */ 42#define SO_SNDTIMEO 0x1005 /* send timeout */
43#define SO_RCVTIMEO 0x1006 /* receive timeout */ 43#define SO_RCVTIMEO 0x1006 /* receive timeout */
44#define SO_ACCEPTCONN 0x1009 44#define SO_ACCEPTCONN 0x1009
45#define SO_PROTOCOL 0x1028 /* protocol type */
45 46
46/* linux-specific, might as well be the same as on i386 */ 47/* linux-specific, might as well be the same as on i386 */
47#define SO_NO_CHECK 11 48#define SO_NO_CHECK 11
diff --git a/arch/mn10300/include/asm/socket.h b/arch/mn10300/include/asm/socket.h
index fb5daf438ec9..19d7cf709b77 100644
--- a/arch/mn10300/include/asm/socket.h
+++ b/arch/mn10300/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_SOCKET_H */ 62#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index 885472bf7b78..a658b09df624 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -24,6 +24,7 @@
24#define SO_RCVTIMEO 0x1006 24#define SO_RCVTIMEO 0x1006
25#define SO_ERROR 0x1007 25#define SO_ERROR 0x1007
26#define SO_TYPE 0x1008 26#define SO_TYPE 0x1008
27#define SO_PROTOCOL 0x1028
27#define SO_PEERNAME 0x2000 28#define SO_PEERNAME 0x2000
28 29
29#define SO_NO_CHECK 0x400b 30#define SO_NO_CHECK 0x400b
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h
index 1e5cfad0e3f7..609049d7117e 100644
--- a/arch/powerpc/include/asm/socket.h
+++ b/arch/powerpc/include/asm/socket.h
@@ -64,4 +64,6 @@
64#define SO_TIMESTAMPING 37 64#define SO_TIMESTAMPING 37
65#define SCM_TIMESTAMPING SO_TIMESTAMPING 65#define SCM_TIMESTAMPING SO_TIMESTAMPING
66 66
67#define SO_PROTOCOL 38
68
67#endif /* _ASM_POWERPC_SOCKET_H */ 69#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h
index 02330c50241b..65baa9a83abc 100644
--- a/arch/s390/include/asm/socket.h
+++ b/arch/s390/include/asm/socket.h
@@ -65,4 +65,6 @@
65#define SO_TIMESTAMPING 37 65#define SO_TIMESTAMPING 37
66#define SCM_TIMESTAMPING SO_TIMESTAMPING 66#define SCM_TIMESTAMPING SO_TIMESTAMPING
67 67
68#define SO_PROTOCOL 38
69
68#endif /* _ASM_SOCKET_H */ 70#endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h
index 982a12f959f4..9cbbfafd0538 100644
--- a/arch/sparc/include/asm/socket.h
+++ b/arch/sparc/include/asm/socket.h
@@ -29,6 +29,8 @@
29#define SO_RCVBUFFORCE 0x100b 29#define SO_RCVBUFFORCE 0x100b
30#define SO_ERROR 0x1007 30#define SO_ERROR 0x1007
31#define SO_TYPE 0x1008 31#define SO_TYPE 0x1008
32#define SO_PROTOCOL 0x1028
33
32 34
33/* Linux specific, keep the same. */ 35/* Linux specific, keep the same. */
34#define SO_NO_CHECK 0x000b 36#define SO_NO_CHECK 0x000b
diff --git a/arch/x86/include/asm/socket.h b/arch/x86/include/asm/socket.h
index ca8bf2cd0ba9..1077d2535a32 100644
--- a/arch/x86/include/asm/socket.h
+++ b/arch/x86/include/asm/socket.h
@@ -57,4 +57,6 @@
57#define SO_TIMESTAMPING 37 57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING 58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59 59
60#define SO_PROTOCOL 38
61
60#endif /* _ASM_X86_SOCKET_H */ 62#endif /* _ASM_X86_SOCKET_H */
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
index dd1a7a4a1cea..e47f172142f1 100644
--- a/arch/xtensa/include/asm/socket.h
+++ b/arch/xtensa/include/asm/socket.h
@@ -68,4 +68,6 @@
68#define SO_TIMESTAMPING 37 68#define SO_TIMESTAMPING 37
69#define SCM_TIMESTAMPING SO_TIMESTAMPING 69#define SCM_TIMESTAMPING SO_TIMESTAMPING
70 70
71#define SO_PROTOCOL 38
72
71#endif /* _XTENSA_SOCKET_H */ 73#endif /* _XTENSA_SOCKET_H */