Line data Source code
1 : /* $Id: gmpp_private.h 346474 2009-11-14 10:18:58Z ssiano $ 2 : * 3 : * gmpp_private.h - Private definitions for GMP generic packet handling support 4 : * 5 : * Dave Katz, March 2008 6 : * 7 : * Copyright (c) 2008, Juniper Networks, Inc. 8 : * Copyright Contributors to the OpenSDN project 9 : * All rights reserved. 10 : */ 11 : 12 : #ifndef __GMPP_PRIVATE_H__ 13 : #define __GMPP_PRIVATE_H__ 14 : 15 : /* 16 : * Context block 17 : * 18 : * There is one of these, statically allocated, for each client role 19 : * (host/router.) It tracks all necessary state for each client. 20 : */ 21 : typedef struct gmpp_context_ { 22 : void *ctx_client_context; /* Client's context */ 23 : gmp_xmit_callback_func ctx_xmit_cb; /* Transmit callback */ 24 : gmp_xmit_peek_callback_func ctx_xmit_peek_cb; /* Transmit peek callback */ 25 : gmp_rcv_peek_callback_func ctx_rcv_peek_cb; /* Receive peek callback */ 26 : gmp_rcv_callback_func ctx_rcv_cb; /* Receive callback */ 27 : gmp_group_done_callback_func ctx_group_cb; /* Group-done callback */ 28 : gmp_packet_free_callback_func ctx_pkt_free_cb; /* Free-packet callback */ 29 : boolean ctx_proto_active[GMP_NUM_PROTOS]; /* True if protocol is active */ 30 : } gmpp_context; 31 : 32 : 33 : /* 34 : * I/O context block 35 : * 36 : * There is one block per role, per protocol. It defines the transmit-ready 37 : * callback used to drive packet transmission. 38 : * 39 : * Normally, the same callback is used for all interfaces, but a tree of 40 : * exceptions exists for specific interfaces needing a different callback. 41 : */ 42 : typedef struct gmpp_io_context_ { 43 : gmpp_xmit_ready_func io_ctx_xmitready_cb; /* Transmit-ready callback */ 44 : gmpx_patroot *io_ctx_exceptions; /* Tree of exception interfaces */ 45 : } gmpp_io_context; 46 : 47 : typedef struct gmpp_io_exception_ { 48 : gmpx_patnode io_ctx_node; /* Node on context tree */ 49 : gmpx_intf_id io_ctx_intf; /* Interface ID */ 50 : gmpp_xmit_ready_func io_ctx_alt_cb; /* Callback for this interface */ 51 : } gmpp_io_exception; 52 : 53 2847 : GMPX_PATNODE_TO_STRUCT(gmpp_patnode_to_io_ex, gmpp_io_exception, io_ctx_node); 54 : 55 : #endif /* __GMPP_PRIVATE_H__ */