Changeset 745 for trunk/server/lib/tsocket/tsocket.h
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/lib/tsocket/tsocket.h
r480 r745 84 84 85 85 /** 86 * @brief Get a string representa ion of the endpoint.86 * @brief Get a string representation of the endpoint. 87 87 * 88 88 * This function creates a string representation of the endpoint for debugging. … … 102 102 * @return The address as a string representation, NULL on error. 103 103 * 104 * @see tsocket_address_is_inet() 104 105 * @see tsocket_address_inet_addr_string() 105 106 * @see tsocket_address_inet_port() … … 486 487 * @{ 487 488 */ 489 490 /** 491 * @brief Find out if the tsocket_address represents an ipv4 or ipv6 endpoint. 492 * 493 * @param[in] addr The tsocket_address pointer 494 * 495 * @param[in] fam The family can be can be "ipv4", "ipv6" or "ip". With 496 * "ip" is autodetects "ipv4" or "ipv6" based on the 497 * addr. 498 * 499 * @return true if addr represents an address of the given family, 500 * otherwise false. 501 */ 502 bool tsocket_address_is_inet(const struct tsocket_address *addr, const char *fam); 488 503 489 504 #if DOXYGEN … … 534 549 * @return A newly allocated string of the address, NULL on error 535 550 * with errno set. 551 * 552 * @see tsocket_address_is_inet() 536 553 */ 537 554 char *tsocket_address_inet_addr_string(const struct tsocket_address *addr, … … 559 576 uint16_t port); 560 577 578 /** 579 * @brief Find out if the tsocket_address represents an unix domain endpoint. 580 * 581 * @param[in] addr The tsocket_address pointer 582 * 583 * @return true if addr represents an unix domain endpoint, 584 * otherwise false. 585 */ 586 bool tsocket_address_is_unix(const struct tsocket_address *addr); 587 561 588 #ifdef DOXYGEN 562 589 /** … … 570 597 * 571 598 * @return 0 on success, -1 on error with errno set. 599 * 600 * @see tsocket_address_is_unix() 572 601 */ 573 602 int tsocket_address_unix_from_path(TALLOC_CTX *mem_ctx, … … 696 725 * @param[in] mem_ctx The talloc memory context to use. 697 726 * 698 * @param[ in]stream A tstream_context pointer to setup the tcp communication727 * @param[out] stream A tstream_context pointer to setup the tcp communication 699 728 * on. This function will allocate the memory. 729 * 730 * @param[out] local The real 'inet' tsocket_address of the local endpoint. 731 * This parameter is optional and can be NULL. 700 732 * 701 733 * @return 0 on success, -1 on error with perrno set. … … 704 736 int *perrno, 705 737 TALLOC_CTX *mem_ctx, 706 struct tstream_context **stream); 738 struct tstream_context **stream, 739 struct tsocket_address **local) 707 740 #else 708 741 int _tstream_inet_tcp_connect_recv(struct tevent_req *req, … … 710 743 TALLOC_CTX *mem_ctx, 711 744 struct tstream_context **stream, 745 struct tsocket_address **local, 712 746 const char *location); 713 #define tstream_inet_tcp_connect_recv(req, perrno, mem_ctx, stream ) \714 _tstream_inet_tcp_connect_recv(req, perrno, mem_ctx, stream, \747 #define tstream_inet_tcp_connect_recv(req, perrno, mem_ctx, stream, local) \ 748 _tstream_inet_tcp_connect_recv(req, perrno, mem_ctx, stream, local, \ 715 749 __location__) 716 750 #endif … … 874 908 * freed. If you still want to use the fd you have have to create a duplicate. 875 909 * 876 * @param[in] mem_ctx The talloc memory context to use. 877 * 878 * @param[in] fd The non blocking fd to use! 879 * 880 * @param[in] stream The filed tstream_context you allocated before. 881 * 882 * @return 0 on success, -1 on error with errno set. 883 * 884 * @warning You should read the tsocket_bsd.c code and unterstand it in order 885 * use this function. 910 * @param[in] mem_ctx The talloc memory context to use. 911 * 912 * @param[in] fd The non blocking fd to use! 913 * 914 * @param[out] stream A pointer to store an allocated tstream_context. 915 * 916 * @return 0 on success, -1 on error. 917 * 918 * Example: 919 * @code 920 * fd2 = dup(fd); 921 * rc = tstream_bsd_existing_socket(mem_ctx, fd2, &tstream); 922 * if (rc < 0) { 923 * stream_terminate_connection(conn, "named_pipe_accept: out of memory"); 924 * return; 925 * } 926 * @endcode 927 * 928 * @warning This is an internal function. You should read the code to fully 929 * understand it if you plan to use it. 886 930 */ 887 931 int tstream_bsd_existing_socket(TALLOC_CTX *mem_ctx,
Note:
See TracChangeset
for help on using the changeset viewer.