/usr/include/globus/globus_xio_udp_driver.h is in libglobus-xio-dev 3.6-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | /*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_XIO_UDP_DRIVER_INCLUDE
#define GLOBUS_XIO_UDP_DRIVER_INCLUDE
/**
* @file
* Header file for XIO UDP Driver
*/
#include "globus_xio_system.h"
/**
* @defgroup udp_driver Globus XIO UDP Driver
* The IPV4/6 UDP socket driver.
*/
/**
* @defgroup udp_driver_instance Opening/Closing
* @ingroup udp_driver
*
* An XIO handle with the udp driver can be created with
* @ref globus_xio_handle_create().
*
* The handle can be created in two modes: open server or connected client.
* If the contact string does not have a host and port, the udp socket will
* accept messages from any sender. If a host and port is specified, the udp
* socket will be 'connected' immediately to that host:port. This blocks
* packets from any sender other than the contact string. A handle that starts
* out as an open server can later be 'connected' with
* @ref GLOBUS_XIO_UDP_CONNECT (presumably after the first message is received
* from a sender and his contact info is available).
*
* When the XIO handle is closed, the udp driver will destroy its internal
* resources and close the socket (unless this socket was set on the attr to
* @ref globus_xio_register_open()).
*/
/**
* @defgroup udp_driver_io Reading/Writing
* @ingroup udp_driver
*
* @ref globus_xio_register_read() semantics:
*
* If the waitforbytes parameter is greater than zero, the read will happen
* asynchronously and be completed when at least waitforbytes has been
* read/written.
*
* If the waitforbytes parameter is equal to zero, one of the following
* alternative behaviors occur:
*
* If the length of the buffer is > 0 the read happens synchronously. If
* the user is using one of the blocking xio calls, no internal callback will
* occur.
*
* If the length of the buffer is also 0, the call behaves like an asynchronous
* notification of data ready to be read. ie, an asynchronous select().
*
* In any case, when an error occurs before the waitforbytes request
* has been met, the outgoing nbytes is set to the amount of data actually
* read before the error occurred.
*
* If the handle is not connected, the user should pass in a data descriptor.
* After the read, this data_descriptor will contain the contact string of the
* sender. The user can either get this contact string with
* @ref GLOBUS_XIO_UDP_GET_CONTACT or pass the data descriptor directly to
* @ref globus_xio_register_write() to send a message back to the sender.
*
* Also, if the handle is not connected, the waitforbytes should probably be
* 1 to guarantee that only one packet is received and the sender contact isnt
* overwritten by multiple packets from different senders.
*
* @ref globus_xio_register_write() semantics:
*
* When performing a write, exactly one UDP packet is sent of the entire
* buffer length. The waitforbytes parameter is ignored. If the entire buffer
* can not be written, a @ref GLOBUS_XIO_UDP_ERROR_SHORT_WRITE error will be
* returned with nbytes set to the number of bytes actually sent.
*
* If the handle is not 'connected', a contact string must be set in the
* data descriptor to @ref globus_xio_register_write(). This can either be
* done explicitly with @ref GLOBUS_XIO_UDP_SET_CONTACT or implicitly by
* passing in a data descriptor received from @ref globus_xio_register_read().
*
* The udp write semantics are always synchronous. No blocking or internal
* callback will occur when using @ref globus_xio_write().
*/
/**
* @defgroup udp_driver_envs Env Variables
* @ingroup udp_driver
*
* The udp driver uses the following environment variables
* - GLOBUS_HOSTNAME Used when setting the hostname in the contact string
* - GLOBUS_UDP_PORT_RANGE Used to restrict the port the udp socket binds to
* - GLOBUS_XIO_SYSTEM_DEBUG Available if using a debug build. See
* globus_debug.h for format. The UDP driver uses globus_xio_system
* (along with the File and TCP drivers) which defines the following
* levels: TRACE for all function call tracing, DATA for data read and
* written counts, INFO for some special events, and RAW which dumps the
* raw buffers actually read or written. This can contain binary data,
* so be careful when you enable it.
*/
/**
* @defgroup udp_driver_cntls Attributes and Cntls
* @ingroup udp_driver
*
* UDP driver specific attrs and cntls.
*
* @see globus_xio_attr_cntl()
* @see globus_xio_handle_cntl()
* @see globus_xio_data_descriptor_cntl()
*/
/**
* @defgroup udp_driver_types Types
* @ingroup udp_driver
*/
/**
* @defgroup udp_driver_errors Error Types
* @ingroup udp_driver
*
* The UDP driver is very close to the system code, so most errors
* reported by it are converted from the system errno. A few of the exceptions
* are GLOBUS_XIO_ERROR_COMMAND, GLOBUS_XIO_ERROR_CONTACT_STRING,
* GLOBUS_XIO_ERROR_CANCELED, @ref GLOBUS_XIO_UDP_ERROR_NO_ADDRS,
* and @ref GLOBUS_XIO_UDP_ERROR_SHORT_WRITE
*
* @see globus_xio_driver_error_match()
* @see globus_error_errno_match()
*/
/**
* Invalid handle type
* @ingroup udp_driver_types
* @hideinitializer
* @see GLOBUS_XIO_UDP_SET_HANDLE
*/
#define GLOBUS_XIO_UDP_INVALID_HANDLE GLOBUS_XIO_SYSTEM_INVALID_SOCKET
/**
* UDP driver specific error types
* @ingroup udp_driver_errors
*/
typedef enum
{
/**
* Indicates that no IPv4/6 compatible sockets could be resolved
* for the specified hostname
*/
GLOBUS_XIO_UDP_ERROR_NO_ADDRS,
/**
* Indicates that a write of the full buffer failed. Possibly need to
* increase the send buffer size.
*/
GLOBUS_XIO_UDP_ERROR_SHORT_WRITE
} globus_xio_udp_error_type_t;
/** doxygen varargs filter stuff
* GlobusVarArgDefine(
* attr, globus_result_t, globus_xio_attr_cntl, attr, driver)
* GlobusVarArgDefine(
* handle, globus_result_t, globus_xio_handle_cntl, handle, driver)
* GlobusVarArgDefine(
* dd, globus_result_t, globus_xio_data_descriptor_cntl, dd, driver)
*/
/**
* UDP driver specific cntls
* @ingroup udp_driver_cntls
*/
typedef enum
{
/** GlobusVarArgEnum(attr)
* Set the udp socket to use.
* @ingroup udp_driver_cntls
*
* @param handle
* Use this handle (fd or SOCKET).
* Note: close() will not be called on this handle.
*/
/* globus_xio_system_socket_t handle */
GLOBUS_XIO_UDP_SET_HANDLE,
/** GlobusVarArgEnum(attr)
* Set the udp service name to listen on.
* @ingroup udp_driver_cntls
*
* @param service_name
* The service name to use when setting up the listener. If the
* service name cannot be resolved, the port (if one is set) will
* be used instead.
*/
/* const char * service_name */
GLOBUS_XIO_UDP_SET_SERVICE,
/** GlobusVarArgEnum(attr)
* Get the service name to listen on.
* @ingroup udp_driver_cntls
*
* @param service_name_out
* A pointer to the service name will be stored here If none is set,
* NULL will be passed back. Otherwise, the name will be
* duplicated with strdup() and the user should call free() on it.
*/
/* char ** service_name_out */
GLOBUS_XIO_UDP_GET_SERVICE,
/** GlobusVarArgEnum(attr)
* Set the port number to listen on.
* @ingroup udp_driver_cntls
* The default is 0 (system assigned)
*
* @param listener_port
* The port number to use when setting up the listener. If the
* service name is also set, this will only be used if that can't be
* resolved.
*/
/* int listener_port */
GLOBUS_XIO_UDP_SET_PORT,
/** GlobusVarArgEnum(attr)
* the port number to listen on.
* @ingroup udp_driver_cntls
*
* @param listener_port_out
* The port will be stored here.
*/
/* int * listener_port_out */
GLOBUS_XIO_UDP_GET_PORT,
/** GlobusVarArgEnum(attr)
* Set the port range to confine the listener to.
* @ingroup udp_driver_cntls
* Used only where no specific service or port has been set. It overrides
* the range set in the GLOBUS_UDP_PORT_RANGE env variable. If
* 'restrict port' is true, the listening port will be constrained to the
* range specified.
*
* @param listener_min_port
* The lower bound on the listener port. (default 0 -- no bound)
*
* @param listener_max_port
* The upper bound on the listener port. (default 0 -- no bound)
*
* @see GLOBUS_XIO_UDP_SET_RESTRICT_PORT
*/
/* int listener_min_port,
* int listener_max_port */
GLOBUS_XIO_UDP_SET_LISTEN_RANGE,
/** GlobusVarArgEnum(attr)
* Get the udp port range on an attr.
* @ingroup udp_driver_cntls
*
* @param listener_min_port_out
* The lower bound will be stored here.
*
* @param listener_max_port_out
* The upper bound will be stored here.
*/
/* int * listener_min_port_out,
* int * listener_max_port_out */
GLOBUS_XIO_UDP_GET_LISTEN_RANGE,
/** GlobusVarArgEnum(attr)
* Set the interface to bind the socket to.
* @ingroup udp_driver_cntls
*
* @param interface
* The interface to use. Can be a hostname or numeric IP
*/
/* const char * interface */
GLOBUS_XIO_UDP_SET_INTERFACE,
/** GlobusVarArgEnum(attr)
* Get the interface on the attr.
* @ingroup udp_driver_cntls
*
* @param interface_out
* A pointer to the interface will be stored here If one is set,
* NULL will be passed back. Otherwise, the interface will be
* duplicated with strdup() and the user should call free() on it.
*/
/* char ** interface_out */
GLOBUS_XIO_UDP_GET_INTERFACE,
/** GlobusVarArgEnum(attr)
* Enable or disable the listener range constraints.
* @ingroup udp_driver_cntls
* This enables or ignores the port range found in the attr or in then env.
* By default, those ranges are enabled.
*
* @param restrict_port
* GLOBUS_TRUE to enable (default), GLOBUS_FALSE to disable.
*
* @see GLOBUS_XIO_UDP_SET_LISTEN_RANGE
*/
/* globus_bool_t restrict_port */
GLOBUS_XIO_UDP_SET_RESTRICT_PORT,
/** GlobusVarArgEnum(attr)
* Get the restrict port flag.
* @ingroup udp_driver_cntls
*
* @param restrict_port_out
* The restrict port flag will be stored here.
*/
/* globus_bool_t * restrict_port_out */
GLOBUS_XIO_UDP_GET_RESTRICT_PORT,
/** GlobusVarArgEnum(attr)
* Reuse addr when binding.
* @ingroup udp_driver_cntls
* Used to determine whether or not to allow reuse of addresses when
* binding a socket to a port number.
*
* @param resuseaddr
* GLOBUS_TRUE to allow, GLOBUS_FALSE to disallow (default)
*/
/* globus_bool_t resuseaddr */
GLOBUS_XIO_UDP_SET_REUSEADDR,
/** GlobusVarArgEnum(attr)
* Get the reuseaddr flag on an attr.
* @ingroup udp_driver_cntls
*
* @param resuseaddr_out
* The reuseaddr flag will be stored here.
*/
/* globus_bool_t * resuseaddr_out */
GLOBUS_XIO_UDP_GET_REUSEADDR,
/** GlobusVarArgEnum(attr)
* Restrict to IPV4 only.
* @ingroup udp_driver_cntls
* Disallow IPV6 sockets from being used
* (default is to use either ipv4 or ipv6)
*
* @param no_ipv6
* GLOBUS_TRUE to disallow ipv6, GLOBUS_FALSE to allow (default)
*/
/* globus_bool_t no_ipv6 */
GLOBUS_XIO_UDP_SET_NO_IPV6,
/** GlobusVarArgEnum(attr)
* Get the no ipv6 flag on an attr.
* @ingroup udp_driver_cntls
*
* @param no_ipv6_out
* The no ipv6 flag will be stored here.
*/
/* globus_bool_t * no_ipv6_out */
GLOBUS_XIO_UDP_GET_NO_IPV6,
/** GlobusVarArgEnum(attr, handle)
* Get the socket handle on an attr or handle.
* @ingroup udp_driver_cntls
*
* @param handle_out
* The udp socket will be stored here. If none is set,
* GLOBUS_XIO_UDP_INVALID_HANDLE will be set.
*/
/* globus_xio_system_socket_t * handle_out */
GLOBUS_XIO_UDP_GET_HANDLE,
/** GlobusVarArgEnum(attr, handle)
* Set the socket send buffer size.
* @ingroup udp_driver_cntls
* Used to set the size of the send buffer used on the socket.
*
* @param sndbuf
* The send buffer size in bytes to use. (default is system specific)
*/
/* int sndbuf */
GLOBUS_XIO_UDP_SET_SNDBUF,
/** GlobusVarArgEnum(attr, handle)
* Get the send buffer size on the attr or handle.
* @ingroup udp_driver_cntls
*
* @param sndbuf_out
* The send buffer size will be stored here.
*/
/* int * sndbuf_out */
GLOBUS_XIO_UDP_GET_SNDBUF,
/** GlobusVarArgEnum(attr, handle)
* Set the socket receive buffer size.
* @ingroup udp_driver_cntls
* Used to set the size of the receive buffer used on the socket.
*
* @param rcvbuf
* The receive buffer size in bytes. (default is system specific)
*/
/* int rcvbuf */
GLOBUS_XIO_UDP_SET_RCVBUF,
/** GlobusVarArgEnum(attr, handle)
* Get the receive buffer size on the attr or handle.
* @ingroup udp_driver_cntls
*
* @param rcvbuf_out
* The receive buffer size will be stored here.
*/
/* int * rcvbuf_out */
GLOBUS_XIO_UDP_GET_RCVBUF,
/** GlobusVarArgEnum(handle, dd)
* Get the contact string associated with a handle or data descriptor.
* @ingroup udp_driver_cntls
* Use with globus_xio_handle_cntl() to get a contact string for the udp
* listener. Use with globus_xio_data_descriptor_cntl() to get the
* sender's contact string from a data descriptor passed to
* @ref globus_xio_register_read().
*
* @param contact_string_out
* A pointer to a contact string will be stored here. The user
* should free() it when done with it. It will be in the
* format: \<hostname\>:\<port\>
*
* @see GLOBUS_XIO_GET_LOCAL_CONTACT
*/
/* char ** contact_string_out */
GLOBUS_XIO_UDP_GET_CONTACT,
/** GlobusVarArgEnum(handle, dd)
* Get the contact string associated with a handle or data descriptor.
* @ingroup udp_driver_cntls
* Use with globus_xio_handle_cntl() to get a contact string for the udp
* listener. Use with globus_xio_data_descriptor_cntl() to get the
* sender's contact string from a data descriptor passed to
* @ref globus_xio_register_read().
*
* @param contact_string_out
* A pointer to a contact string will be stored here. The user
* should free() it when done with it. It will be in the
* format: \<ip\>:\<port\>
*
* @see GLOBUS_XIO_GET_LOCAL_NUMERIC_CONTACT
*/
/* char ** contact_string_out */
GLOBUS_XIO_UDP_GET_NUMERIC_CONTACT,
/** GlobusVarArgEnum(dd)
* Set the destination contact.
* @ingroup udp_driver_cntls
* Use on a data descriptor passed to @ref globus_xio_register_write() to
* specify the recipient of the data. This is necessary with unconnected
* handles or to send to recipients other than the connected one.
*
* @param contact_string
* A pointer to a contact string of the format
* \<hostname/ip\>:\<port/service\>
*
* @see GLOBUS_XIO_UDP_CONNECT
*/
/* char * contact_string */
GLOBUS_XIO_UDP_SET_CONTACT,
/** GlobusVarArgEnum(handle)
* Set the default destination contact.
* @ingroup udp_driver_cntls
* Connecting a handle to a specific contact blocks packets from any other
* contact. It also sets the default destination of all outgoing packets
* so, using @ref GLOBUS_XIO_UDP_SET_CONTACT is unnecessary.
*
* @param contact_string
* A pointer to a contact string of the format
* \<hostname/ip\>:\<port/service\>
*/
/* char * contact_string */
GLOBUS_XIO_UDP_CONNECT,
/** GlobusVarArgEnum(attr)
* Join a multicast group.
* @ingroup udp_driver_cntls
* Specifiy a multicast group to join. All packets received will be
* to the specified multicast address. Do not use
* @ref GLOBUS_XIO_UDP_CONNECT, @ref GLOBUS_XIO_UDP_SET_PORT, or
* pass a contact string on the open. Consider using
* @ref GLOBUS_XIO_UDP_SET_REUSEADDR to allow other apps to join this
* group. Use @ref GLOBUS_XIO_UDP_SET_INTERFACE to specify the
* interface to use. Will not affect handles set with
* @ref GLOBUS_XIO_UDP_SET_HANDLE. @ref GLOBUS_XIO_UDP_SET_RESTRICT_PORT
* is ignored.
*
* @param contact_string
* A pointer to a contact string of the multicast group to join with
* the format: \<hostname/ip\>:\<port/service\>
*/
/* char * contact_string */
GLOBUS_XIO_UDP_SET_MULTICAST
} globus_xio_udp_cmd_t;
#endif
|