66 #define NET_RecvFrom JVM_RecvFrom
67 #define NET_ReadV readv
68 #define NET_Send JVM_Send
69 #define NET_SendTo JVM_SendTo
70 #define NET_WriteV writev
71 #define NET_Connect JVM_Connect
72 #define NET_Accept JVM_Accept
73 #define NET_SocketClose JVM_SocketClose
74 #define NET_Dup2 dup2
75 #define NET_Select select
76 #define NET_Poll poll
77
78 #endif
79
80 #if defined(__linux__) && defined(AF_INET6)
81 int getDefaultIPv6Interface(struct in6_addr *target_addr);
82 #endif
83
84 #ifdef __solaris__
85 extern int net_getParam(char *driver, char *param);
86 #endif
87
88 /* needed from libsocket on Solaris 8 */
89
90 typedef int (*getaddrinfo_f)(const char *nodename, const char *servname,
91 const struct addrinfo *hints, struct addrinfo **res);
92
93 typedef void (*freeaddrinfo_f)(struct addrinfo *);
94
95 typedef const char * (*gai_strerror_f)(int ecode);
96
97 typedef int (*getnameinfo_f)(const struct sockaddr *, size_t,
98 char *, size_t, char *, size_t, int);
99
100 extern getaddrinfo_f getaddrinfo_ptr;
101 extern freeaddrinfo_f freeaddrinfo_ptr;
102 extern getnameinfo_f getnameinfo_ptr;
103
104 void ThrowUnknownHostExceptionWithGaiError(JNIEnv *env,
105 const char* hostname,
106 int gai_error);
107
|
66 #define NET_RecvFrom JVM_RecvFrom
67 #define NET_ReadV readv
68 #define NET_Send JVM_Send
69 #define NET_SendTo JVM_SendTo
70 #define NET_WriteV writev
71 #define NET_Connect JVM_Connect
72 #define NET_Accept JVM_Accept
73 #define NET_SocketClose JVM_SocketClose
74 #define NET_Dup2 dup2
75 #define NET_Select select
76 #define NET_Poll poll
77
78 #endif
79
80 #if defined(__linux__) && defined(AF_INET6)
81 int getDefaultIPv6Interface(struct in6_addr *target_addr);
82 #endif
83
84 #ifdef __solaris__
85 extern int net_getParam(char *driver, char *param);
86
87 #ifndef SO_FLOW_SLA
88 #define SO_FLOW_SLA 0x1018
89
90 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
91 #pragma pack(4)
92 #endif
93
94 /*
95 * Used with the setsockopt(SO_FLOW_SLA, ...) call to set
96 * per socket service level properties.
97 * When the application uses per-socket API, we will enforce the properties
98 * on both outbound and inbound packets.
99 *
100 * For now, only priority and maxbw are supported in SOCK_FLOW_PROP_VERSION1.
101 */
102 typedef struct sock_flow_props_s {
103 int sfp_version;
104 uint32_t sfp_mask;
105 int sfp_priority; /* flow priority */
106 uint64_t sfp_maxbw; /* bandwidth limit in bps */
107 int sfp_status; /* flow create status for getsockopt */
108 } sock_flow_props_t;
109
110 #define SOCK_FLOW_PROP_VERSION1 1
111
112 /* bit mask values for sfp_mask */
113 #define SFP_MAXBW 0x00000001 /* Flow Bandwidth Limit */
114 #define SFP_PRIORITY 0x00000008 /* Flow priority */
115
116 /* possible values for sfp_priority */
117 #define SFP_PRIO_NORMAL 1
118 #define SFP_PRIO_HIGH 2
119
120 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
121 #pragma pack()
122 #endif /* _LONG_LONG_ALIGNMENT */
123
124 #endif /* SO_FLOW_SLA */
125 #endif /* __solaris__ */
126
127 /* needed from libsocket on Solaris 8 */
128
129 typedef int (*getaddrinfo_f)(const char *nodename, const char *servname,
130 const struct addrinfo *hints, struct addrinfo **res);
131
132 typedef void (*freeaddrinfo_f)(struct addrinfo *);
133
134 typedef const char * (*gai_strerror_f)(int ecode);
135
136 typedef int (*getnameinfo_f)(const struct sockaddr *, size_t,
137 char *, size_t, char *, size_t, int);
138
139 extern getaddrinfo_f getaddrinfo_ptr;
140 extern freeaddrinfo_f freeaddrinfo_ptr;
141 extern getnameinfo_f getnameinfo_ptr;
142
143 void ThrowUnknownHostExceptionWithGaiError(JNIEnv *env,
144 const char* hostname,
145 int gai_error);
146
|