00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef ISC_SOCKET_H
00021 #define ISC_SOCKET_H 1
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 #include <isc/event.h>
00061 #include <isc/eventclass.h>
00062 #include <isc/lang.h>
00063 #include <isc/json.h>
00064 #include <isc/region.h>
00065 #include <isc/sockaddr.h>
00066 #include <isc/time.h>
00067 #include <isc/types.h>
00068 #include <isc/xml.h>
00069 
00070 #ifdef WIN32
00071 
00072 
00073 
00074 #define isc_socket_create isc__socket_create
00075 #define isc_socket_dup isc__socket_dup
00076 #define isc_socket_attach isc__socket_attach
00077 #define isc_socket_detach isc__socket_detach
00078 #define isc_socketmgr_create isc__socketmgr_create
00079 #define isc_socketmgr_create2 isc__socketmgr_create2
00080 #define isc_socketmgr_destroy isc__socketmgr_destroy
00081 #define isc_socket_open isc__socket_open
00082 #define isc_socket_close isc__socket_close
00083 #define isc_socket_recvv isc__socket_recvv
00084 #define isc_socket_recv isc__socket_recv
00085 #define isc_socket_recv2 isc__socket_recv2
00086 #define isc_socket_send isc__socket_send
00087 #define isc_socket_sendto isc__socket_sendto
00088 #define isc_socket_sendv isc__socket_sendv
00089 #define isc_socket_sendtov isc__socket_sendtov
00090 #define isc_socket_sendtov2 isc__socket_sendtov2
00091 #define isc_socket_sendto2 isc__socket_sendto2
00092 #define isc_socket_cleanunix isc__socket_cleanunix
00093 #define isc_socket_permunix isc__socket_permunix
00094 #define isc_socket_bind isc__socket_bind
00095 #define isc_socket_filter isc__socket_filter
00096 #define isc_socket_listen isc__socket_listen
00097 #define isc_socket_accept isc__socket_accept
00098 #define isc_socket_connect isc__socket_connect
00099 #define isc_socket_getfd isc__socket_getfd
00100 #define isc_socket_getname isc__socket_getname
00101 #define isc_socket_gettag isc__socket_gettag
00102 #define isc_socket_getpeername isc__socket_getpeername
00103 #define isc_socket_getsockname isc__socket_getsockname
00104 #define isc_socket_cancel isc__socket_cancel
00105 #define isc_socket_gettype isc__socket_gettype
00106 #define isc_socket_isbound isc__socket_isbound
00107 #define isc_socket_ipv6only isc__socket_ipv6only
00108 #define isc_socket_setname isc__socket_setname
00109 #define isc_socketmgr_getmaxsockets isc__socketmgr_getmaxsockets
00110 #define isc_socketmgr_setstats isc__socketmgr_setstats
00111 #define isc_socketmgr_setreserved isc__socketmgr_setreserved
00112 #define isc__socketmgr_maxudp isc___socketmgr_maxudp
00113 #define isc_socket_fdwatchcreate isc__socket_fdwatchcreate
00114 #define isc_socket_fdwatchpoke isc__socket_fdwatchpoke
00115 #define isc_socket_dscp isc__socket_dscp
00116 
00117 #endif
00118 
00119 ISC_LANG_BEGINDECLS
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 #define ISC_SOCKET_MAXSCATTERGATHER     8
00130 
00131 
00132 
00133 
00134 
00135 #define ISC_SOCKET_REUSEADDRESS         0x01U
00136 
00137 
00138 
00139 
00140 enum {
00141         isc_sockstatscounter_udp4open = 0,
00142         isc_sockstatscounter_udp6open = 1,
00143         isc_sockstatscounter_tcp4open = 2,
00144         isc_sockstatscounter_tcp6open = 3,
00145         isc_sockstatscounter_unixopen = 4,
00146 
00147         isc_sockstatscounter_udp4openfail = 5,
00148         isc_sockstatscounter_udp6openfail = 6,
00149         isc_sockstatscounter_tcp4openfail = 7,
00150         isc_sockstatscounter_tcp6openfail = 8,
00151         isc_sockstatscounter_unixopenfail = 9,
00152 
00153         isc_sockstatscounter_udp4close = 10,
00154         isc_sockstatscounter_udp6close = 11,
00155         isc_sockstatscounter_tcp4close = 12,
00156         isc_sockstatscounter_tcp6close = 13,
00157         isc_sockstatscounter_unixclose = 14,
00158         isc_sockstatscounter_fdwatchclose = 15,
00159 
00160         isc_sockstatscounter_udp4bindfail = 16,
00161         isc_sockstatscounter_udp6bindfail = 17,
00162         isc_sockstatscounter_tcp4bindfail = 18,
00163         isc_sockstatscounter_tcp6bindfail = 19,
00164         isc_sockstatscounter_unixbindfail = 20,
00165         isc_sockstatscounter_fdwatchbindfail = 21,
00166 
00167         isc_sockstatscounter_udp4connect = 22,
00168         isc_sockstatscounter_udp6connect = 23,
00169         isc_sockstatscounter_tcp4connect = 24,
00170         isc_sockstatscounter_tcp6connect = 25,
00171         isc_sockstatscounter_unixconnect = 26,
00172         isc_sockstatscounter_fdwatchconnect = 27,
00173 
00174         isc_sockstatscounter_udp4connectfail = 28,
00175         isc_sockstatscounter_udp6connectfail = 29,
00176         isc_sockstatscounter_tcp4connectfail = 30,
00177         isc_sockstatscounter_tcp6connectfail = 31,
00178         isc_sockstatscounter_unixconnectfail = 32,
00179         isc_sockstatscounter_fdwatchconnectfail = 33,
00180 
00181         isc_sockstatscounter_tcp4accept = 34,
00182         isc_sockstatscounter_tcp6accept = 35,
00183         isc_sockstatscounter_unixaccept = 36,
00184 
00185         isc_sockstatscounter_tcp4acceptfail = 37,
00186         isc_sockstatscounter_tcp6acceptfail = 38,
00187         isc_sockstatscounter_unixacceptfail = 39,
00188 
00189         isc_sockstatscounter_udp4sendfail = 40,
00190         isc_sockstatscounter_udp6sendfail = 41,
00191         isc_sockstatscounter_tcp4sendfail = 42,
00192         isc_sockstatscounter_tcp6sendfail = 43,
00193         isc_sockstatscounter_unixsendfail = 44,
00194         isc_sockstatscounter_fdwatchsendfail = 45,
00195 
00196         isc_sockstatscounter_udp4recvfail = 46,
00197         isc_sockstatscounter_udp6recvfail = 47,
00198         isc_sockstatscounter_tcp4recvfail = 48,
00199         isc_sockstatscounter_tcp6recvfail = 49,
00200         isc_sockstatscounter_unixrecvfail = 50,
00201         isc_sockstatscounter_fdwatchrecvfail = 51,
00202 
00203         isc_sockstatscounter_udp4active = 52,
00204         isc_sockstatscounter_udp6active = 53,
00205         isc_sockstatscounter_tcp4active = 54,
00206         isc_sockstatscounter_tcp6active = 55,
00207         isc_sockstatscounter_unixactive = 56,
00208 
00209         isc_sockstatscounter_rawopen = 57,
00210         isc_sockstatscounter_rawopenfail = 58,
00211         isc_sockstatscounter_rawclose = 59,
00212         isc_sockstatscounter_rawrecvfail = 60,
00213         isc_sockstatscounter_rawactive = 61,
00214 
00215         isc_sockstatscounter_max = 62
00216 };
00217 
00218 
00219 
00220 
00221 
00222 struct isc_socketevent {
00223         ISC_EVENT_COMMON(isc_socketevent_t);
00224         isc_result_t            result;         
00225         unsigned int            minimum;        
00226         unsigned int            n;              
00227         unsigned int            offset;         
00228         isc_region_t            region;         
00229         isc_bufferlist_t        bufferlist;     
00230         isc_sockaddr_t          address;        
00231         isc_time_t              timestamp;      
00232         struct in6_pktinfo      pktinfo;        
00233         isc_uint32_t            attributes;     
00234         isc_eventdestructor_t   destroy;        
00235         unsigned int            dscp;           
00236 };
00237 
00238 typedef struct isc_socket_newconnev isc_socket_newconnev_t;
00239 struct isc_socket_newconnev {
00240         ISC_EVENT_COMMON(isc_socket_newconnev_t);
00241         isc_socket_t *          newsocket;
00242         isc_result_t            result;         
00243         isc_sockaddr_t          address;        
00244 };
00245 
00246 typedef struct isc_socket_connev isc_socket_connev_t;
00247 struct isc_socket_connev {
00248         ISC_EVENT_COMMON(isc_socket_connev_t);
00249         isc_result_t            result;         
00250 };
00251 
00252 
00253 
00254 
00255 
00256 
00257 
00258 
00259 
00260 
00261 
00262 
00263 
00264 #define ISC_SOCKEVENTATTR_ATTACHED              0x80000000U 
00265 #define ISC_SOCKEVENTATTR_TRUNC                 0x00800000U 
00266 #define ISC_SOCKEVENTATTR_CTRUNC                0x00400000U 
00267 #define ISC_SOCKEVENTATTR_TIMESTAMP             0x00200000U 
00268 #define ISC_SOCKEVENTATTR_PKTINFO               0x00100000U 
00269 #define ISC_SOCKEVENTATTR_MULTICAST             0x00080000U 
00270 #define ISC_SOCKEVENTATTR_DSCP                  0x00040000U 
00271 
00272 
00273 #define ISC_SOCKEVENT_ANYEVENT  (0)
00274 #define ISC_SOCKEVENT_RECVDONE  (ISC_EVENTCLASS_SOCKET + 1)
00275 #define ISC_SOCKEVENT_SENDDONE  (ISC_EVENTCLASS_SOCKET + 2)
00276 #define ISC_SOCKEVENT_NEWCONN   (ISC_EVENTCLASS_SOCKET + 3)
00277 #define ISC_SOCKEVENT_CONNECT   (ISC_EVENTCLASS_SOCKET + 4)
00278 
00279 
00280 
00281 
00282 #define ISC_SOCKEVENT_INTR      (ISC_EVENTCLASS_SOCKET + 256)
00283 #define ISC_SOCKEVENT_INTW      (ISC_EVENTCLASS_SOCKET + 257)
00284 
00285 typedef enum {
00286         isc_sockettype_udp = 1,
00287         isc_sockettype_tcp = 2,
00288         isc_sockettype_unix = 3,
00289         isc_sockettype_fdwatch = 4,
00290         isc_sockettype_raw = 5
00291 } isc_sockettype_t;
00292 
00293 
00294 
00295 
00296 
00297 #define ISC_SOCKSHUT_RECV       0x00000001      
00298 #define ISC_SOCKSHUT_SEND       0x00000002      
00299 #define ISC_SOCKSHUT_ALL        0x00000003      
00300 
00301 
00302 
00303 
00304 
00305 
00306 #define ISC_SOCKCANCEL_RECV     0x00000001      
00307 #define ISC_SOCKCANCEL_SEND     0x00000002      
00308 #define ISC_SOCKCANCEL_ACCEPT   0x00000004      
00309 #define ISC_SOCKCANCEL_CONNECT  0x00000008      
00310 #define ISC_SOCKCANCEL_ALL      0x0000000f      
00311 
00312 
00313 
00314 
00315 
00316 
00317 #define ISC_SOCKFLAG_IMMEDIATE  0x00000001      
00318 #define ISC_SOCKFLAG_NORETRY    0x00000002      
00319 
00320 
00321 
00322 
00323 
00324 
00325 #define ISC_SOCKFDWATCH_READ    0x00000001      
00326 #define ISC_SOCKFDWATCH_WRITE   0x00000002      
00327 
00328 
00329 
00330 typedef struct isc_socketmgrmethods {
00331         void            (*destroy)(isc_socketmgr_t **managerp);
00332         isc_result_t    (*socketcreate)(isc_socketmgr_t *manager, int pf,
00333                                         isc_sockettype_t type,
00334                                         isc_socket_t **socketp);
00335         isc_result_t    (*fdwatchcreate)(isc_socketmgr_t *manager, int fd,
00336                                          int flags,
00337                                          isc_sockfdwatch_t callback,
00338                                          void *cbarg, isc_task_t *task,
00339                                          isc_socket_t **socketp);
00340 } isc_socketmgrmethods_t;
00341 
00342 typedef struct isc_socketmethods {
00343         void            (*attach)(isc_socket_t *socket,
00344                                   isc_socket_t **socketp);
00345         void            (*detach)(isc_socket_t **socketp);
00346         isc_result_t    (*bind)(isc_socket_t *sock, isc_sockaddr_t *sockaddr,
00347                                 unsigned int options);
00348         isc_result_t    (*sendto)(isc_socket_t *sock, isc_region_t *region,
00349                                   isc_task_t *task, isc_taskaction_t action,
00350                                   void *arg, isc_sockaddr_t *address,
00351                                   struct in6_pktinfo *pktinfo);
00352         isc_result_t    (*sendto2)(isc_socket_t *sock, isc_region_t *region,
00353                                    isc_task_t *task, isc_sockaddr_t *address,
00354                                    struct in6_pktinfo *pktinfo,
00355                                    isc_socketevent_t *event,
00356                                    unsigned int flags);
00357         isc_result_t    (*connect)(isc_socket_t *sock, isc_sockaddr_t *addr,
00358                                    isc_task_t *task, isc_taskaction_t action,
00359                                    void *arg);
00360         isc_result_t    (*recv)(isc_socket_t *sock, isc_region_t *region,
00361                                 unsigned int minimum, isc_task_t *task,
00362                                 isc_taskaction_t action, void *arg);
00363         isc_result_t    (*recv2)(isc_socket_t *sock, isc_region_t *region,
00364                                  unsigned int minimum, isc_task_t *task,
00365                                  isc_socketevent_t *event, unsigned int flags);
00366         void            (*cancel)(isc_socket_t *sock, isc_task_t *task,
00367                                   unsigned int how);
00368         isc_result_t    (*getsockname)(isc_socket_t *sock,
00369                                        isc_sockaddr_t *addressp);
00370         isc_sockettype_t (*gettype)(isc_socket_t *sock);
00371         void            (*ipv6only)(isc_socket_t *sock, isc_boolean_t yes);
00372         isc_result_t    (*fdwatchpoke)(isc_socket_t *sock, int flags);
00373         isc_result_t            (*dup)(isc_socket_t *socket,
00374                                   isc_socket_t **socketp);
00375         int             (*getfd)(isc_socket_t *socket);
00376         void            (*dscp)(isc_socket_t *socket, isc_dscp_t dscp);
00377 } isc_socketmethods_t;
00378 
00379 
00380 
00381 
00382 
00383 
00384 
00385 
00386 
00387 
00388 
00389 
00390 
00391 
00392 #ifndef WIN32
00393 struct isc_socketmgr {
00394         unsigned int            impmagic;
00395         unsigned int            magic;
00396         isc_socketmgrmethods_t  *methods;
00397 };
00398 #endif
00399 
00400 #define ISCAPI_SOCKETMGR_MAGIC          ISC_MAGIC('A','s','m','g')
00401 #define ISCAPI_SOCKETMGR_VALID(m)       ((m) != NULL && \
00402                                          (m)->magic == ISCAPI_SOCKETMGR_MAGIC)
00403 
00404 
00405 
00406 
00407 
00408 #ifndef WIN32
00409 struct isc_socket {
00410         unsigned int            impmagic;
00411         unsigned int            magic;
00412         isc_socketmethods_t     *methods;
00413 };
00414 #endif
00415 
00416 #define ISCAPI_SOCKET_MAGIC     ISC_MAGIC('A','s','c','t')
00417 #define ISCAPI_SOCKET_VALID(s)  ((s) != NULL && \
00418                                  (s)->magic == ISCAPI_SOCKET_MAGIC)
00419 
00420 
00421 
00422 
00423 
00424 
00425 
00426 
00427 isc_result_t
00428 isc_socket_fdwatchcreate(isc_socketmgr_t *manager,
00429                          int fd,
00430                          int flags,
00431                          isc_sockfdwatch_t callback,
00432                          void *cbarg,
00433                          isc_task_t *task,
00434                          isc_socket_t **socketp);
00435 
00436 
00437 
00438 
00439 
00440 
00441 
00442 
00443 
00444 
00445 
00446 
00447 
00448 
00449 
00450 
00451 
00452 
00453 
00454 
00455 
00456 
00457 
00458 
00459 
00460 
00461 
00462 
00463 
00464 
00465 
00466 isc_result_t
00467 isc_socket_fdwatchpoke(isc_socket_t *sock,
00468                        int flags);
00469 
00470 
00471 
00472 
00473 
00474 
00475 
00476 
00477 
00478 
00479 
00480 
00481 
00482 
00483 
00484 
00485 
00486 
00487 
00488 
00489 
00490 
00491 
00492 
00493 
00494 
00495 isc_result_t
00496 isc_socket_create(isc_socketmgr_t *manager,
00497                   int pf,
00498                   isc_sockettype_t type,
00499                   isc_socket_t **socketp);
00500 
00501 
00502 
00503 
00504 
00505 
00506 
00507 
00508 
00509 
00510 
00511 
00512 
00513 
00514 
00515 
00516 
00517 
00518 
00519 
00520 
00521 
00522 
00523 
00524 
00525 
00526 
00527 
00528 
00529 
00530 isc_result_t
00531 isc_socket_dup(isc_socket_t *sock0, isc_socket_t **socketp);
00532 
00533 
00534 
00535 
00536 void
00537 isc_socket_cancel(isc_socket_t *sock, isc_task_t *task,
00538                   unsigned int how);
00539 
00540 
00541 
00542 
00543 
00544 
00545 
00546 
00547 
00548 
00549 
00550 
00551 
00552 
00553 
00554 
00555 
00556 
00557 
00558 
00559 
00560 
00561 
00562 
00563 
00564 
00565 
00566 
00567 
00568 void
00569 isc_socket_shutdown(isc_socket_t *sock, unsigned int how);
00570 
00571 
00572 
00573 
00574 
00575 
00576 
00577 
00578 
00579 
00580 
00581 
00582 
00583 
00584 
00585 
00586 
00587 
00588 
00589 
00590 
00591 
00592 void
00593 isc_socket_attach(isc_socket_t *sock, isc_socket_t **socketp);
00594 
00595 
00596 
00597 
00598 
00599 
00600 
00601 
00602 
00603 
00604 
00605 
00606 
00607 
00608 void
00609 isc_socket_detach(isc_socket_t **socketp);
00610 
00611 
00612 
00613 
00614 
00615 
00616 
00617 
00618 
00619 
00620 
00621 
00622 
00623 
00624 
00625 
00626 
00627 
00628 
00629 
00630 
00631 
00632 
00633 
00634 
00635 isc_result_t
00636 isc_socket_open(isc_socket_t *sock);
00637 
00638 
00639 
00640 
00641 
00642 
00643 
00644 
00645 
00646 
00647 
00648 
00649 
00650 
00651 
00652 
00653 
00654 
00655 
00656 
00657 
00658 
00659 
00660 
00661 
00662 
00663 isc_result_t
00664 isc_socket_close(isc_socket_t *sock);
00665 
00666 
00667 
00668 
00669 
00670 
00671 
00672 
00673 
00674 
00675 
00676 
00677 
00678 
00679 
00680 
00681 
00682 
00683 
00684 
00685 
00686 
00687 
00688 
00689 
00690 isc_result_t
00691 isc_socket_bind(isc_socket_t *sock, isc_sockaddr_t *addressp,
00692                 unsigned int options);
00693 
00694 
00695 
00696 
00697 
00698 
00699 
00700 
00701 
00702 
00703 
00704 
00705 
00706 
00707 
00708 
00709 
00710 
00711 
00712 isc_result_t
00713 isc_socket_filter(isc_socket_t *sock, const char *filter);
00714 
00715 
00716 
00717 
00718 
00719 isc_result_t
00720 isc_socket_listen(isc_socket_t *sock, unsigned int backlog);
00721 
00722 
00723 
00724 
00725 
00726 
00727 
00728 
00729 
00730 
00731 
00732 
00733 
00734 
00735 
00736 
00737 
00738 
00739 
00740 
00741 
00742 
00743 isc_result_t
00744 isc_socket_accept(isc_socket_t *sock,
00745                   isc_task_t *task, isc_taskaction_t action, void *arg);
00746 
00747 
00748 
00749 
00750 
00751 
00752 
00753 
00754 
00755 
00756 
00757 
00758 
00759 
00760 
00761 
00762 
00763 
00764 
00765 
00766 isc_result_t
00767 isc_socket_connect(isc_socket_t *sock, isc_sockaddr_t *addressp,
00768                    isc_task_t *task, isc_taskaction_t action,
00769                    void *arg);
00770 
00771 
00772 
00773 
00774 
00775 
00776 
00777 
00778 
00779 
00780 
00781 
00782 
00783 
00784 
00785 
00786 
00787 
00788 
00789 
00790 
00791 
00792 
00793 
00794 
00795 
00796 
00797 
00798 
00799 
00800 isc_result_t
00801 isc_socket_getpeername(isc_socket_t *sock, isc_sockaddr_t *addressp);
00802 
00803 
00804 
00805 
00806 
00807 
00808 
00809 
00810 
00811 
00812 
00813 
00814 
00815 
00816 isc_result_t
00817 isc_socket_getsockname(isc_socket_t *sock, isc_sockaddr_t *addressp);
00818 
00819 
00820 
00821 
00822 
00823 
00824 
00825 
00826 
00827 
00828 
00829 
00830 
00831 
00832 
00833 isc_result_t
00834 isc_socket_recv(isc_socket_t *sock, isc_region_t *region,
00835                 unsigned int minimum,
00836                 isc_task_t *task, isc_taskaction_t action, void *arg);
00837 isc_result_t
00838 isc_socket_recvv(isc_socket_t *sock, isc_bufferlist_t *buflist,
00839                  unsigned int minimum,
00840                  isc_task_t *task, isc_taskaction_t action, void *arg);
00841 
00842 isc_result_t
00843 isc_socket_recv2(isc_socket_t *sock, isc_region_t *region,
00844                  unsigned int minimum, isc_task_t *task,
00845                  isc_socketevent_t *event, unsigned int flags);
00846 
00847 
00848 
00849 
00850 
00851 
00852 
00853 
00854 
00855 
00856 
00857 
00858 
00859 
00860 
00861 
00862 
00863 
00864 
00865 
00866 
00867 
00868 
00869 
00870 
00871 
00872 
00873 
00874 
00875 
00876 
00877 
00878 
00879 
00880 
00881 
00882 
00883 
00884 
00885 
00886 
00887 
00888 
00889 
00890 
00891 
00892 
00893 
00894 
00895 
00896 
00897 
00898 
00899 
00900 
00901 
00902 
00903 
00904 
00905 
00906 
00907 
00908 
00909 
00910 
00911 
00912 
00913 
00914 
00915 
00916 
00917 
00918 
00919 
00920 
00921 isc_result_t
00922 isc_socket_send(isc_socket_t *sock, isc_region_t *region,
00923                 isc_task_t *task, isc_taskaction_t action, void *arg);
00924 isc_result_t
00925 isc_socket_sendto(isc_socket_t *sock, isc_region_t *region,
00926                   isc_task_t *task, isc_taskaction_t action, void *arg,
00927                   isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
00928 isc_result_t
00929 isc_socket_sendv(isc_socket_t *sock, isc_bufferlist_t *buflist,
00930                  isc_task_t *task, isc_taskaction_t action, void *arg);
00931 isc_result_t
00932 isc_socket_sendtov(isc_socket_t *sock, isc_bufferlist_t *buflist,
00933                    isc_task_t *task, isc_taskaction_t action, void *arg,
00934                    isc_sockaddr_t *address, struct in6_pktinfo *pktinfo);
00935 isc_result_t
00936 isc_socket_sendtov2(isc_socket_t *sock, isc_bufferlist_t *buflist,
00937                     isc_task_t *task, isc_taskaction_t action, void *arg,
00938                     isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
00939                     unsigned int flags);
00940 isc_result_t
00941 isc_socket_sendto2(isc_socket_t *sock, isc_region_t *region,
00942                    isc_task_t *task,
00943                    isc_sockaddr_t *address, struct in6_pktinfo *pktinfo,
00944                    isc_socketevent_t *event, unsigned int flags);
00945 
00946 
00947 
00948 
00949 
00950 
00951 
00952 
00953 
00954 
00955 
00956 
00957 
00958 
00959 
00960 
00961 
00962 
00963 
00964 
00965 
00966 
00967 
00968 
00969 
00970 
00971 
00972 
00973 
00974 
00975 
00976 
00977 
00978 
00979 
00980 
00981 
00982 
00983 
00984 
00985 
00986 
00987 
00988 
00989 
00990 
00991 
00992 
00993 
00994 
00995 
00996 
00997 
00998 
00999 
01000 
01001 
01002 
01003 
01004 
01005 
01006 
01007 
01008 
01009 
01010 
01011 
01012 
01013 
01014 
01015 
01016 
01017 
01018 
01019 
01020 isc_result_t
01021 isc_socketmgr_createinctx(isc_mem_t *mctx, isc_appctx_t *actx,
01022                           isc_socketmgr_t **managerp);
01023 
01024 isc_result_t
01025 isc_socketmgr_create(isc_mem_t *mctx, isc_socketmgr_t **managerp);
01026 
01027 isc_result_t
01028 isc_socketmgr_create2(isc_mem_t *mctx, isc_socketmgr_t **managerp,
01029                       unsigned int maxsocks);
01030 
01031 
01032 
01033 
01034 
01035 
01036 
01037 
01038 
01039 
01040 
01041 
01042 
01043 
01044 
01045 
01046 
01047 
01048 
01049 
01050 
01051 
01052 
01053 
01054 
01055 
01056 
01057 
01058 
01059 
01060 
01061 
01062 isc_result_t
01063 isc_socketmgr_getmaxsockets(isc_socketmgr_t *manager, unsigned int *nsockp);
01064 
01065 
01066 
01067 
01068 
01069 
01070 
01071 
01072 
01073 
01074 
01075 
01076 
01077 
01078 void
01079 isc_socketmgr_setstats(isc_socketmgr_t *manager, isc_stats_t *stats);
01080 
01081 
01082 
01083 
01084 
01085 
01086 
01087 
01088 
01089 
01090 
01091 void
01092 isc_socketmgr_destroy(isc_socketmgr_t **managerp);
01093 
01094 
01095 
01096 
01097 
01098 
01099 
01100 
01101 
01102 
01103 
01104 
01105 
01106 
01107 
01108 
01109 
01110 
01111 
01112 
01113 
01114 
01115 
01116 isc_sockettype_t
01117 isc_socket_gettype(isc_socket_t *sock);
01118 
01119 
01120 
01121 
01122 
01123 
01124 
01125 
01126 
01127 isc_boolean_t
01128 isc__socket_isbound(isc_socket_t *sock);
01129 
01130 
01131 
01132 
01133 void
01134 isc_socket_ipv6only(isc_socket_t *sock, isc_boolean_t yes);
01135 
01136 
01137 
01138 
01139 
01140 
01141 
01142 
01143 
01144 void
01145 isc_socket_dscp(isc_socket_t *sock, isc_dscp_t dscp);
01146 
01147 
01148 
01149 
01150 
01151 
01152 
01153 
01154 isc_socketevent_t *
01155 isc_socket_socketevent(isc_mem_t *mctx, void *sender,
01156                        isc_eventtype_t eventtype, isc_taskaction_t action,
01157                        void *arg);
01158 
01159 
01160 
01161 
01162 void
01163 isc_socket_cleanunix(isc_sockaddr_t *addr, isc_boolean_t active);
01164 
01165 
01166 
01167 
01168 
01169 
01170 
01171 
01172 
01173 
01174 
01175 
01176 
01177 
01178 
01179 
01180 isc_result_t
01181 isc_socket_permunix(isc_sockaddr_t *sockaddr, isc_uint32_t perm,
01182                     isc_uint32_t owner, isc_uint32_t group);
01183 
01184 
01185 
01186 
01187 
01188 
01189 
01190 
01191 
01192 
01193 
01194 
01195 
01196 
01197 
01198 void isc_socket_setname(isc_socket_t *socket, const char *name, void *tag);
01199 
01200 
01201 
01202 
01203 
01204 
01205 const char *isc_socket_getname(isc_socket_t *socket);
01206 
01207 
01208 
01209 
01210 void *isc_socket_gettag(isc_socket_t *socket);
01211 
01212 
01213 
01214 
01215 int isc_socket_getfd(isc_socket_t *socket);
01216 
01217 
01218 
01219 
01220 void
01221 isc__socketmgr_setreserved(isc_socketmgr_t *mgr, isc_uint32_t);
01222 
01223 
01224 
01225 
01226 void
01227 isc__socketmgr_maxudp(isc_socketmgr_t *mgr, int maxudp);
01228 
01229 
01230 
01231 
01232 #ifdef HAVE_LIBXML2
01233 int
01234 isc_socketmgr_renderxml(isc_socketmgr_t *mgr, xmlTextWriterPtr writer);
01235 
01236 
01237 
01238 #endif 
01239 
01240 #ifdef HAVE_JSON
01241 isc_result_t
01242 isc_socketmgr_renderjson(isc_socketmgr_t *mgr, json_object *stats);
01243 
01244 
01245 
01246 #endif 
01247 
01248 
01249 
01250 
01251 typedef isc_result_t
01252 (*isc_socketmgrcreatefunc_t)(isc_mem_t *mctx, isc_socketmgr_t **managerp);
01253 
01254 isc_result_t
01255 isc_socket_register(isc_socketmgrcreatefunc_t createfunc);
01256 
01257 
01258 
01259 
01260 
01261 
01262 isc_result_t
01263 isc__socket_register(void);
01264 
01265 
01266 
01267 
01268 
01269 
01270 
01271 ISC_LANG_ENDDECLS
01272 
01273 #endif