00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _SOCKET_H_
00038 #define _SOCKET_H_
00039
00040 #include "conf.h"
00041 #include "socket_enum.h"
00042
00082 LIBPARTICLE_API int p_socket_open(uint32_t localip, uint32_t broadcast_add, int port);
00083
00089 LIBPARTICLE_API int p_socket_close(int sock);
00090
00097 LIBPARTICLE_API int p_socket_set_lastacks(int counter);
00098
00105 LIBPARTICLE_API int p_socket_set_lastdups(int counter);
00106
00115 LIBPARTICLE_API int p_socket_set_ipdest(int sock, const struct in_addr * address);
00116
00125 LIBPARTICLE_API int p_socket_set_ipdest_str(int sock, const char * address);
00126
00134 LIBPARTICLE_API int p_socket_set_ipdest_all(int fd);
00135
00142 LIBPARTICLE_API int p_socket_set_ipsrc_all(int sock);
00143
00152 LIBPARTICLE_API int p_socket_set_ipsrc(int sock, const struct in_addr * address);
00153
00162 LIBPARTICLE_API int p_socket_set_ipsrc_str(int sock , const char * address);
00163
00172 LIBPARTICLE_API int p_socket_set_id(int sock, const uint8_t * add);
00173
00184 LIBPARTICLE_API int p_socket_set_id_str(int sock, const char * addstr);
00185
00194 LIBPARTICLE_API int p_socket_set_loc(int sock, const uint8_t * loc);
00195
00204 LIBPARTICLE_API int p_socket_set_loc_str(int sock, const char * locstr);
00205
00242 LIBPARTICLE_API int p_socket_set_option(int fd, int option, int mode);
00243
00252 LIBPARTICLE_API int p_socket_set_retry(int sock, uint8_t retries, uint32_t timeout);
00253
00259 LIBPARTICLE_API void p_describe_socket(int sock);
00260
00266 LIBPARTICLE_API int p_socket_get_lastacks(void);
00267
00268
00276 LIBPARTICLE_API uint8_t* p_socket_get_id(int fd);
00277
00285 LIBPARTICLE_API uint8_t* p_socket_get_loc(int fd);
00286
00298 LIBPARTICLE_API uint8_t * p_socket_get_ipdest(int fd, int device_number);
00299
00305 LIBPARTICLE_API int p_socket_get_num_interfaces(int fd);
00306
00317 LIBPARTICLE_API int p_socket_set_num_interfaces(int fd, int counter);
00318
00326 LIBPARTICLE_API uint8_t * p_socket_get_ipsrc(int fd);
00327
00334 LIBPARTICLE_API int p_socket_get_retry(int fd);
00335
00342 LIBPARTICLE_API uint32_t p_socket_get_timeout(int fd);
00343
00349 LIBPARTICLE_API uint16_t p_socket_get_port(int fd);
00350
00360 LIBPARTICLE_API int p_socket_get_option(int fd, int option);
00361
00368 LIBPARTICLE_API int p_socket_get_blocking(int fd);
00369
00376 LIBPARTICLE_API int p_socket_get_broadcast(int fd);
00377
00385 LIBPARTICLE_API uint8_t p_socket_get_last_seq(int fd);
00386
00387
00388
00389
00390
00391
00392
00393
00394
00410 LIBPARTICLE_API struct p_packet *p_socket_recv(int recv_sock, int send_sock);
00411
00412
00427 LIBPARTICLE_API struct p_packet *p_socket_recv_filtered(int recv_sock, int send_sock, int recv_filter);
00428
00442 LIBPARTICLE_API int p_socket_recv_raw(int sock, char * data, size_t maxlen);
00443
00452 struct timeval;
00453 LIBPARTICLE_API int p_socket_select(int fd, uint16_t milliseconds);
00454
00455
00456
00457
00458
00459
00460
00461
00462
00472 LIBPARTICLE_API int p_socket_send(int send_sock, struct p_packet * send_data);
00473
00508 LIBPARTICLE_API int p_socket_send_addressed(int send_sock, struct p_packet * send_data, uint8_t * add);
00509
00527 LIBPARTICLE_API int p_socket_send_addressed_str(int send_sock, struct p_packet * send_data, const char * add_str);
00528
00552 LIBPARTICLE_API int p_socket_send_acked(int send_sock, int recv_sock, struct p_packet * send_data, const uint8_t * add);
00553
00554
00578 LIBPARTICLE_API int p_socket_send_acked_str(int send_sock, int recv_sock, struct p_packet * send_data, const char * addstr);
00579
00603 LIBPARTICLE_API int p_socket_send_buffer(int fd_out, int fd_in, const char * buf, uint32_t len, const uint8_t * sendto, const uint8_t * acl_type);
00604
00629 LIBPARTICLE_API int p_socket_send_buffer_str(int fd_out, int fd_in, const char * buf, uint32_t len, const char * sendto, const char * acl_type);
00630
00655 LIBPARTICLE_API int p_socket_send_file(int fd_out, int fd_in, const char * filename, const uint8_t * sendto, const uint8_t * acl_type);
00656
00670 LIBPARTICLE_API int p_socket_send_raw(int sock, const char * data, size_t len);
00671
00679 LIBPARTICLE_API int p_socket_get_send_status(int sendticket);
00680
00688 LIBPARTICLE_API int p_socket_delete_send_context(int sendticket);
00689
00690
00691
00692
00693
00694
00695
00696
00697
00702 int p_socket_set_broadcast();
00703
00708 int p_socket_set_blocking();
00709
00714 int p_socket_set_autoack();
00715
00720 int p_socket_set_recv_option();
00721
00726 int p_socket_set_frag_option();
00727
00728
00729
00730
00731
00734 #endif
00735