Changeset 988 for vendor/current/lib/tsocket/tsocket.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/tsocket/tsocket.h
r860 r988 628 628 TALLOC_CTX *mem_ctx); 629 629 630 #ifdef DOXYGEN 631 /** 632 * @brief Wrap an existing file descriptors into the tdgram abstraction. 633 * 634 * You can use this function to wrap an existing file descriptors into the 635 * tdgram abstraction. After that you're not able to use this file descriptor 636 * for anything else. The file descriptor will be closed when the stream gets 637 * freed. If you still want to use the fd you have have to create a duplicate. 638 * 639 * @param[in] mem_ctx The talloc memory context to use. 640 * 641 * @param[in] fd The non blocking fd to use! 642 * 643 * @param[out] dgram A pointer to store an allocated tdgram_context. 644 * 645 * @return 0 on success, -1 on error. 646 * 647 * Example: 648 * @code 649 * fd2 = dup(fd); 650 * rc = tdgram_bsd_existing_socket(mem_ctx, fd2, &tdgram); 651 * if (rc < 0) { 652 * return; 653 * } 654 * @endcode 655 * 656 * @warning This is an internal function. You should read the code to fully 657 * understand it if you plan to use it. 658 */ 659 int tdgram_bsd_existing_socket(TALLOC_CTX *mem_ctx, 660 int fd, 661 struct tdgram_context **dgram); 662 #else 663 int _tdgram_bsd_existing_socket(TALLOC_CTX *mem_ctx, 664 int fd, 665 struct tdgram_context **_dgram, 666 const char *location); 667 #define tdgram_bsd_existing_socket(mem_ctx, fd, dgram) \ 668 _tdgram_bsd_existing_socket(mem_ctx, fd, dgram, \ 669 __location__) 670 #endif 671 630 672 /** 631 673 * @brief Request a syscall optimization for tdgram_recvfrom_send() … … 664 706 * 665 707 * @return 0 on success, -1 on error with errno set. 708 * 709 * @see tdgram_inet_udp_broadcast_socket() 666 710 */ 667 711 int tdgram_inet_udp_socket(const struct tsocket_address *local, … … 677 721 #define tdgram_inet_udp_socket(local, remote, mem_ctx, dgram) \ 678 722 _tdgram_inet_udp_socket(local, remote, mem_ctx, dgram, __location__) 723 #endif 724 725 #ifdef DOXYGEN 726 /** 727 * @brief Create a tdgram_context for a ipv4 UDP broadcast (and unicast) communication. 728 * 729 * @param[in] local An 'inet' (ipv4 only) tsocket_address for the local endpoint. 730 * 731 * @param[in] mem_ctx The talloc memory context to use. 732 * 733 * @param[in] dgram The tdgram_context pointer to setup the udp 734 * communication. The function will allocate the memory. 735 * 736 * @return 0 on success, -1 on error with errno set. 737 * 738 * @see tdgram_inet_udp_socket() 739 */ 740 int tdgram_inet_udp_broadcast_socket(const struct tsocket_address *local, 741 TALLOC_CTX *mem_ctx, 742 struct tdgram_context **dgram); 743 #else 744 int _tdgram_inet_udp_broadcast_socket(const struct tsocket_address *local, 745 TALLOC_CTX *mem_ctx, 746 struct tdgram_context **dgram, 747 const char *location); 748 #define tdgram_inet_udp_broadcast_socket(local, mem_ctx, dgram) \ 749 _tdgram_inet_udp_broadcast_socket(local, mem_ctx, dgram, __location__) 679 750 #endif 680 751 … … 898 969 */ 899 970 int tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx, 900 struct sockaddr *sa,971 const struct sockaddr *sa, 901 972 size_t sa_socklen, 902 973 struct tsocket_address **addr); 903 974 #else 904 975 int _tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx, 905 struct sockaddr *sa,976 const struct sockaddr *sa, 906 977 size_t sa_socklen, 907 978 struct tsocket_address **_addr,
Note:
See TracChangeset
for help on using the changeset viewer.