OSDN Git Service

stop using trunk or dist directory in rec10 project.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / network.h
diff --git a/tstools/DtsEdit/src/gpac/network.h b/tstools/DtsEdit/src/gpac/network.h
deleted file mode 100644 (file)
index f41d8c6..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/*\r
- *                     GPAC - Multimedia Framework C SDK\r
- *\r
- *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
- *                                     All rights reserved\r
- *\r
- *  This file is part of GPAC / common tools sub-project\r
- *\r
- *  GPAC is free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU Lesser General Public License as published by\r
- *  the Free Software Foundation; either version 2, or (at your option)\r
- *  any later version.\r
- *   \r
- *  GPAC is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- *  GNU Lesser General Public License for more details.\r
- *   \r
- *  You should have received a copy of the GNU Lesser General Public\r
- *  License along with this library; see the file COPYING.  If not, write to\r
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
- *\r
- */\r
-\r
-#ifndef _GF_NET_H_\r
-#define _GF_NET_H_\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-/*!\r
- *     \file <gpac/network.h>\r
- *     \brief IP network functions.\r
- */\r
-\r
- /*!\r
- *     \addtogroup net_grp network\r
- *     \ingroup utils_grp\r
- *     \brief IP Network Functions\r
- *\r
- *This section documents the IP network functions of the GPAC framework.\r
- *     @{\r
- */\r
-\r
-#include <gpac/tools.h>\r
-\r
-\r
-/*!\r
- *\brief URL local test\r
- *\r
- *Tests whether a URL describes a local file or not\r
- *\param url the url to analyze\r
- *\return 1 if the URL describes a local file, 0 otherwise\r
- */\r
-Bool gf_url_is_local(const char *url);\r
-\r
-/*!\r
- *\brief gets absolute file path\r
- *\r
- *Gets the absolute file path from a relative path and its parent absolute one. This can only be used with file paths.\r
- *\param pathName the relative path name of a file\r
- *\param parentPath the absolute parent path name \r
- *\return absolute path name of the file, or NULL if bad paths are provided.\r
- \note the returned string must be freed by user\r
- */\r
-char *gf_url_get_absolute_path(const char *pathName, const char *parentPath);\r
-/*concatenates URL and gets back full URL - returned string must be freed by user*/\r
-/*!\r
- *\brief URL concatenation\r
- *\r
- *Concatenates a relative URL with its parent URL\r
- *\param parentName URL of the parent service\r
- *\param pathName URL of the service\r
- *\return absolute path name of the service, or NULL if bad paths are provided or if the service path is already an absolute one.\r
- \note the returned string must be freed by user\r
- */\r
-char *gf_url_concatenate(const char *parentName, const char *pathName);\r
-\r
-\r
-/*!\r
- *\brief URL to file system\r
- *\r
- *Converts a local URL to a file system value. Removes all white spaces and similar\r
- *\param url url to convert\r
- */\r
-void gf_url_to_fs_path(char *url);\r
-\r
-/*!\r
- *\brief gets UTC time \r
- *\r
- *Gets UTC time since midnight Jan 1970\r
- *\param sec number of seconds\r
- *\param msec number of milliseconds\r
- */\r
-void gf_utc_time_since_1970(u32 *sec, u32 *msec);\r
-\r
-\r
-/*!\r
- *     \brief NTP seconds from 1900 to 1970\r
- *     \hideinitializer\r
- *\r
- *     Macro giving the number of seconds from from 1900 to 1970\r
-*/\r
-#define GF_NTP_SEC_1900_TO_1970 2208988800ul\r
-\r
-/*!\r
- *\brief gets NTP time \r
- *\r
- *Gets NTP (Network Time Protocol) in seconds and fractional side\r
- \param sec NTP time in seconds\r
- \param frac fractional NTP time expressed in 1 / (1<<32 - 1) seconds units\r
- */\r
-void gf_net_get_ntp(u32 *sec, u32 *frac);\r
-\r
-/*!\r
- * Socket options\r
- *     \hideinitializer\r
- */\r
-enum\r
-{\r
-       /*!Reuses port.*/\r
-       GF_SOCK_REUSE_PORT = 1,\r
-       /*!Forces IPV6 if available.*/\r
-       GF_SOCK_FORCE_IPV6 = 1<<1\r
-};\r
-\r
-/*!\r
- *\brief abstracted socket object\r
- *\r
- *The abstracted socket object allows you to build client and server applications very simply\r
- *with support for unicast and multicast (no IPv6 yet)\r
-*/\r
-typedef struct __tag_socket GF_Socket;\r
-\r
-/*!Buffer size to pass for IP address retrieval*/\r
-#define GF_MAX_IP_NAME_LEN     516\r
-\r
-/*!socket is a TCP socket*/\r
-#define GF_SOCK_TYPE_TCP               0x01\r
-/*!socket is a UDP socket*/\r
-#define GF_SOCK_TYPE_UDP               0x02\r
-\r
-/*!\r
- *\brief socket constructor\r
- *\r
- *Constructs a socket object\r
- *\param SocketType the socket type to create, either UDP or TCP\r
- *\return the socket object or NULL if network initialization failure\r
- */\r
-GF_Socket *gf_sk_new(u32 SocketType);\r
-/*!\r
- *\brief socket destructor\r
- *\r
- *Deletes a socket object\r
- *\param sock the socket object\r
- */\r
-void gf_sk_del(GF_Socket *sock);\r
-\r
-/*!\r
- *\brief reset internal buffer\r
- *\r
- *Forces the internal socket buffer to be reseted (discarded)\r
- *\param sock the socket object\r
- */\r
-void gf_sk_reset(GF_Socket *sock);\r
-/*!\r
- *\brief socket buffer size control\r
- *\r
- *Sets the size of the internal buffer of the socket. The socket MUST be bound or connected before.\r
- *\param sock the socket object\r
- *\param send_buffer if 0, sets the size of the reception buffer, otherwise sets the size of the emission buffer\r
- *\param new_size new size of the buffer in bytes.\r
- *\warning This operation may fail depending on the provider, hardware...\r
- */\r
-GF_Err gf_sk_set_buffer_size(GF_Socket *sock, Bool send_buffer, u32 new_size);\r
-\r
-/*!\r
- *\brief blocking mode control\r
- *\r
- *Sets the blocking mode of a socket on or off. A blocking socket will wait for the net operation to be possible \r
- *while a non-blocking one would return an error. By default, sockets are created in blocking mode\r
- *\param sock the socket object\r
- *\param NonBlockingOn set to 1 to use on-blocking sockets, 0 otherwise\r
- */\r
-GF_Err gf_sk_set_block_mode(GF_Socket *sock, Bool NonBlockingOn);\r
-/*!\r
- *\brief socket binding\r
- *\r
- *Binds the given socket to the specified port.\r
- *\param local_ip the local interface IP address if desired. If NULL, the default interface will be used.\r
- *\param sock the socket object\r
- *\param port port number to bind this socket to\r
- *\param peer_name the remote server address\r
- *\param peer_port remote port number to connect the socket to\r
- *\param options list of option for the bind operation.\r
- */\r
-GF_Err gf_sk_bind(GF_Socket *sock, char *local_ip, u16 port, char *peer_name, u16 peer_port, u32 options);\r
-/*!\r
- *\brief connects a socket \r
- *\r
- *Connects a socket to a remote peer on a given port \r
- *\param sock the socket object\r
- *\param peer_name the remote server address (IP or DNS)\r
- *\param port remote port number to connect the socket to\r
- *\param local_ip the local (client) address (IP or DNS) if any, NULL otherwise.\r
- */\r
-GF_Err gf_sk_connect(GF_Socket *sock, char *peer_name, u16 port, char *local_ip);\r
-/*!\r
- *\brief data emission\r
- *\r
- *Sends a buffer on the socket. The socket must be in a bound or connected mode\r
- *\param sock the socket object\r
- *\param buffer the data buffer to send\r
- *\param length the data length to send\r
- */\r
-GF_Err gf_sk_send(GF_Socket *sock, char *buffer, u32 length);\r
-/*!\r
- *\brief data reception\r
- * \r
- *Fetches data on a socket. The socket must be in a bound or connected state\r
- *\param sock the socket object\r
- *\param buffer the recpetion buffer where data is written\r
- *\param length the allocated size of the reception buffer\r
- *\param start_from the offset in the reception buffer where to start writing\r
- *\param read the actual number of bytes received\r
- */\r
-GF_Err gf_sk_receive(GF_Socket *sock, char *buffer, u32 length, u32 start_from, u32 *read);\r
-/*!\r
- *\brief socket listening\r
- *\r
- *Sets the socket in a listening state. This socket must have been bound to a port before \r
- *\param sock the socket object\r
- *\param max_conn the maximum number of simultaneous connection this socket will accept\r
- */\r
-GF_Err gf_sk_listen(GF_Socket *sock, u32 max_conn);\r
-/*!\r
- *\brief socket accept\r
- *\r
- *Accepts an incomming connection on a listening socket\r
- *\param sock the socket object\r
- *\param new_conn the resulting connection socket object\r
- */\r
-GF_Err gf_sk_accept(GF_Socket *sock, GF_Socket **new_conn);\r
-\r
-/*!\r
- *\brief server socket mode \r
- *\r
- *Disable the Nable algo (e.g. set TCP_NODELAY) and set the KEEPALIVE on \r
- *\param sock the socket object\r
- *\param server_on sets server mode on or off\r
-*/\r
-GF_Err gf_sk_server_mode(GF_Socket *sock, Bool server_on);\r
-\r
-/*!\r
- *\brief get local host name\r
- *\r
- *Retrieves local host name.\r
- *\param buffer destination buffer for name. Buffer must be GF_MAX_IP_NAME_LEN long\r
- */\r
-GF_Err gf_sk_get_host_name(char *buffer);\r
-\r
-/*!\r
- *\brief get local IP\r
- *\r
- *Gets local IP address of a connected socket, typically used for server after an ACCEPT\r
- *\param sock the socket object\r
- *\param buffer destination buffer for IP address. Buffer must be GF_MAX_IP_NAME_LEN long\r
- */\r
-GF_Err gf_sk_get_local_ip(GF_Socket *sock, char *buffer);\r
-/*!\r
- *\brief get local info\r
- *\r
- *Gets local socket info of a socket\r
- *\param sock the socket object\r
- *\param port local port number of the socket\r
- *\param sock_type socket type (UDP or TCP)\r
- */\r
-GF_Err gf_sk_get_local_info(GF_Socket *sock, u16 *port, u32 *sock_type);\r
-\r
-/*!\r
- *\brief get remote address\r
- *\r
- *Gets the remote address of a peer. The socket MUST be connected.\r
- *\param sock the socket object\r
- *\param buffer destination buffer for IP address. Buffer must be GF_MAX_IP_NAME_LEN long\r
- */\r
-GF_Err gf_sk_get_remote_address(GF_Socket *sock, char *buffer);\r
-\r
-/*!\r
- *\brief set remote address\r
- *\r
- *Sets the remote address of a socket. This is used by connectionless sockets using SendTo and ReceiveFrom\r
- *\param sock the socket object\r
- *\param address the remote peer address\r
- *\param port the remote peer port\r
- */\r
-GF_Err gf_sk_set_remote(GF_Socket *sock, char *address, u16 port);\r
-\r
-\r
-/*!\r
- *\brief multicast setup\r
- *\r
- *Performs multicast setup (BIND and JOIN) for the socket object\r
- *\param sock the socket object\r
- *\param multi_ip_add the multicast IP address\r
- *\param multi_port the multicast port number\r
- *\param TTL the multicast TTL (Time-To-Live)\r
- *\param no_bind if sets, only join the multicast\r
- *\param local_interface_ip the local interface IP address if desired. If NULL, the default interface will be used.\r
- */\r
-GF_Err gf_sk_setup_multicast(GF_Socket *sock, char *multi_ip_add, u16 multi_port, u32 TTL, Bool no_bind, char *local_interface_ip);\r
-/*!\r
- *brief multicast address test\r
- *\r
- *tests whether an IP address is a multicast one or not\r
- *\param multi_ip_add the multicast IP address to test\r
- *\return 1 if the address is a multicast one, 0 otherwise\r
- */\r
-u32 gf_sk_is_multicast_address(char *multi_ip_add);\r
-\r
-/*!\r
- *\brief send data with wait delay\r
- *\r
- *Sends data with a max wait delay. This is used for http / ftp sockets mainly. The socket must be connected.\r
- *\param sock the socket object\r
- *\param buffer the data buffer to send\r
- *\param length the data length to send\r
- *\param delay_sec the maximum delay in second to wait before aborting\r
- *\return If the operation timeed out, the function will return a GF_IP_SOCK_WOULD_BLOCK error.\r
- */\r
-GF_Err gf_sk_send_wait(GF_Socket *sock, char *buffer, u32 length, u32 delay_sec);\r
-/* receive data with a max wait delay of Second - used for http / ftp sockets mainly*/\r
-/*!\r
- *\brief receive data with wait delay\r
- *\r
- *Fetches data with a max wait delay. This is used for http / ftp sockets mainly. The socket must be connected.\r
- *\param sock the socket object\r
- *\param buffer the recpetion buffer where data is written\r
- *\param length the allocated size of the reception buffer\r
- *\param start_from the offset in the reception buffer where to start writing\r
- *\param read the actual number of bytes received\r
- *\param delay_sec the maximum delay in second to wait before aborting\r
- *\return If the operation timeed out, the function will return a GF_IP_SOCK_WOULD_BLOCK error.\r
- */\r
-GF_Err gf_sk_receive_wait(GF_Socket *sock, char *buffer, u32 length, u32 start_from, u32 *read, u32 delay_sec);\r
-\r
-/*!\r
- *\brief gets socket handle\r
- *\r
- *Gets the socket low-level handle as used by OpenSSL.\r
- *\param sock the socket object\r
- *\return the socket handle\r
- */\r
-s32 gf_sk_get_handle(GF_Socket *sock);\r
-\r
-\r
-/*!\r
- *\brief gets ipv6 support\r
- *\r
- *Returns IPV6 support information.\r
- *\return 2 if the machine has IPV6 support, 1 if the library was compiled with IPV6 support, 0 otherwise\r
- */\r
-u32 gf_net_has_ipv6();\r
-\r
-\r
-/*!\r
- *\brief checks address type\r
- *\r
- *Checks if an address is an IPV6 or IPV4 one.\r
- *\return true 1 if address is IPV6 one, 0 otherwise\r
- */\r
-Bool gf_net_is_ipv6(char *address);\r
-\r
-\r
-/*!\r
- *     \brief MobileIP Callback\r
- *\r
- * The gf_net_mobileip_ctrl_cbk type is the type for the callback of the \ref gf_net_set_mobileip_callback function. By default no mobileip is used\r
- *     \param cbck Opaque user data.\r
- *     \param start boolean indicating wether the MobileIP subsystem should be started or stoped.\r
- *     \return Error code if needed.\r
- *\r
- */\r
-typedef GF_Err (*gf_net_mobileip_ctrl_cbk)(Bool start);\r
-\r
-/*!\r
- *\brief Assigns MobileIP callback\r
- *\r
- *Assigns the MobileIP control callback.\r
- *\param _mobip_cbk MobileIP control callback\r
- */\r
-void gf_net_mobileip_set_callback(gf_net_mobileip_ctrl_cbk _mobip_cbk, const char *MobileIP);\r
-\r
-/*! @} */\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-\r
-#endif         /*_GF_NET_H_*/\r
-\r