paulo@0: /* paulo@0: * $Id: rx_layer.h,v 1.3 2004/02/01 08:17:12 hipnod Exp $ paulo@0: * paulo@0: * Copyright (C) 2003 giFT project (gift.sourceforge.net) paulo@0: * paulo@0: * This program is free software; you can redistribute it and/or modify it paulo@0: * under the terms of the GNU General Public License as published by the paulo@0: * Free Software Foundation; either version 2, or (at your option) any paulo@0: * later version. paulo@0: * paulo@0: * This program is distributed in the hope that it will be useful, but paulo@0: * WITHOUT ANY WARRANTY; without even the implied warranty of paulo@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU paulo@0: * General Public License for more details. paulo@0: */ paulo@0: paulo@0: #ifndef GIFT_GT_RX_LAYER_H_ paulo@0: #define GIFT_GT_RX_LAYER_H_ paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #include "rx_stack.h" paulo@0: #include "io_buf.h" paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: struct gt_rx_stack; paulo@0: struct rx_layer; paulo@0: paulo@0: struct rx_layer_ops paulo@0: { paulo@0: BOOL (*init) (struct rx_layer *layer, void *udata); paulo@0: void (*destroy) (struct rx_layer *layer); paulo@0: void (*enable) (struct rx_layer *layer); paulo@0: void (*disable) (struct rx_layer *layer); paulo@0: void (*recv) (struct rx_layer *layer, struct io_buf *io_buf); paulo@0: }; paulo@0: paulo@0: struct rx_layer paulo@0: { paulo@0: const char *name; paulo@0: void *udata; paulo@0: struct rx_layer_ops *ops; paulo@0: BOOL enabled; paulo@0: paulo@0: struct rx_layer *upper; paulo@0: struct rx_layer *lower; paulo@0: paulo@0: struct gt_rx_stack *stack; paulo@0: }; paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: struct rx_layer *gt_rx_layer_new (struct gt_rx_stack *stack, paulo@0: const char *name, paulo@0: struct rx_layer_ops *ops, void *udata); paulo@0: void gt_rx_layer_free (struct rx_layer *layer); paulo@0: paulo@0: void gt_rx_layer_disable (struct rx_layer *layer); paulo@0: void gt_rx_layer_enable (struct rx_layer *layer); paulo@0: paulo@0: /* pass a message buffer up to preceding layers */ paulo@0: void gt_rx_layer_recv (struct rx_layer *layer, paulo@0: struct io_buf *io_buf); paulo@0: paulo@0: /*****************************************************************************/ paulo@0: paulo@0: #endif /* GIFT_GT_RX_LAYER_H_ */