X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=include%2Ftr_event.h;h=55cc27287f1e4913c41ef1b40fa99b211e0f666b;hb=98be752015619fab5d29405bea10158a0e26d044;hp=5fab89cba8e47324c035db0735b1f12f26f3027d;hpb=1b419d2f80dd88c79565bece98dfcb591e722b3e;p=trust_router.git diff --git a/include/tr_event.h b/include/tr_event.h index 5fab89c..55cc272 100644 --- a/include/tr_event.h +++ b/include/tr_event.h @@ -1,12 +1,49 @@ +/* + * Copyright (c) 2016, JANET(UK) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of JANET(UK) nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + #ifndef TR_EVENT_H #define TR_EVENT_H #include +#define TR_MAX_SOCKETS 10 + /* struct for hanging on to a socket listener event */ struct tr_socket_event { - int sock_fd; /* the fd for the socket */ - struct event *ev; /* its event */ + int n_sock_fd; /* how many of those are filled in? */ + int sock_fd[TR_MAX_SOCKETS]; /* the fd for the socket */ + struct event *ev[TR_MAX_SOCKETS]; /* its events */ }; /* prototypes */