/* * Copyright (C) James R. Leu 2000 * jleu@mindspring.com * * This software is covered under the LGPL, for more * info check out http://www.gnu.org/copyleft/lgpl.html */ #ifndef _LDP_SOCKET_IMPL_H_ #define _LDP_SOCKET_IMPL_H_ #include "ldp_struct.h" /* * in: handle * return: ldp_bool */ extern ldp_bool ldp_socket_mgr_handle_verify(ldp_socket_mgr_handle handle); /* * in: handle, socket * return: ldp_bool */ extern ldp_bool ldp_socket_handle_verify(ldp_socket_mgr_handle handle, ldp_socket_handle socket); /* * in: handle * return: ldp_socket_mgr_handle */ extern ldp_socket_mgr_handle ldp_socket_mgr_open( const ldp_instance_handle handle); /* * in: handle */ extern void ldp_socket_mgr_close(const ldp_socket_mgr_handle handle); /* * in: handle * return: ldp_socket_handle */ extern ldp_socket_handle ldp_socket_create_tcp( const ldp_socket_mgr_handle handle); /* * in: handle * return: ldp_socket_handle */ extern ldp_socket_handle ldp_socket_create_udp( const ldp_socket_mgr_handle handle); /* * in: handle,socket,from * out: from * return: ldp_socket_handle */ extern ldp_socket_handle ldp_socket_tcp_accept( const ldp_socket_mgr_handle handle,const ldp_socket_handle socket, ldp_dest* from); /* * in: handle,socket */ extern void ldp_socket_close(const ldp_socket_mgr_handle handle, ldp_socket_handle socket); /* * in: handle,socket,local * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_bind(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,const ldp_dest* local); /* * in: handle, socket, flag * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_options(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,const uint32_t flag); /* * in: handle, socket, depth * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_tcp_listen(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,const int depth); /* * in: handle, socket, to * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_tcp_connect( const ldp_socket_mgr_handle handle,ldp_socket_handle socket, const ldp_dest* to); /* * in: handle, socket * return: int */ extern int ldp_socket_get_errno(const ldp_socket_mgr_handle handle, ldp_socket_handle socket); /* * in: handle, socket * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_connect_status( const ldp_socket_mgr_handle handle,ldp_socket_handle socket); /* * in: handle, socket, ttl, loop * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_multicast_options( const ldp_socket_mgr_handle handle,ldp_socket_handle socket, const int ttl,const int loop); /* * in: handle, socket, iff * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_multicast_if_tx( const ldp_socket_mgr_handle handle,ldp_socket_handle socket, const ldp_if* iff); /* * in: handle, socket, iff, mult * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_multicast_if_join( const ldp_socket_mgr_handle handle,ldp_socket_handle socket, const ldp_if* iff,const ldp_inet_addr *mult); /* * in: handle, socket, iff, mult */ extern void ldp_socket_multicast_if_drop(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,const ldp_if* iff, const ldp_inet_addr *mult); /* * in: handle, socket, object, type * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_readlist_add( const ldp_socket_mgr_handle handle,ldp_socket_handle socket, void* object,const ldp_socket_enum type); /* * in: handle, socket */ extern void ldp_socket_readlist_del(const ldp_socket_mgr_handle handle, ldp_socket_handle socket); /* * in: handle, socket, object, type * return: ldp_return_enum */ extern ldp_return_enum ldp_socket_writelist_add( const ldp_socket_mgr_handle handle,ldp_socket_handle socket, void* object,const ldp_socket_enum type); /* * in: handle, socket */ extern void ldp_socket_writelist_del(const ldp_socket_mgr_handle handle, ldp_socket_handle socket); /* * in: handle, o * return: int */ extern int ldp_socket_tcp_read(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,uint8_t* buffer, const int size); /* * in: handle, o * return: int */ extern int ldp_socket_tcp_write(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,uint8_t* buffer, const int size); /* * in: handle, o * return: int */ extern int ldp_socket_udp_sendto(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,uint8_t* buffer, const int size, const ldp_dest *to); /* * in: handle, o * return: int */ extern int ldp_socket_udp_recvfrom(const ldp_socket_mgr_handle handle, ldp_socket_handle socket,uint8_t* buffer, const int size, ldp_dest *from); #endif