/* $Id: mcl.h,v 1.1.1.1 2003/09/03 12:45:43 chneuman Exp $ */ /* * Copyright (c) 1999-2003 INRIA - Universite Paris 6 - All rights reserved * (main author: Vincent Roca - vincent.roca@inrialpes.fr) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef MCL_H /* { */ #define MCL_H /****** general purpose macros ******/ #ifndef min #define min(a,b) ((a) <= (b) ? (a) : (b)) #endif #ifndef max #define max(a,b) ((a) >= (b) ? (a) : (b)) #endif /* WARNING: works only with integers */ #define is_odd(v) ( ((v) & 1) ? 1 : 0) /****** constants: do not edit ******/ /* * max length of char strings / paht+file names */ #define MAX_NAME_LEN 64 #define MAX_FILE_NAME_LEN 256 /* * print stats every STATS_PERIOD usec at most */ #define STATS_PERIOD 5000000 /* * call the memory cleanup functin with this period (in time tick) */ #define TX_MEM_CLEANUP_PERIOD 50 /* * socket snd/recv buffer management */ #define GET_SOCKBUF 1 #define SET_SOCKBUF 2 #define NEW_SOCKBUF_SZ 49152 /* * sender or receiver; used as argument to some functions * do not change... */ #define SENDER 1 #define RECEIVER 0 /* * used by mcl_drop_layer; check or really drop ? */ #define MCL_CHECK_ONLY 1 #define MCL_DO_IT 0 #define MCL_ALL_LAYERS 254 /* used by add/drop functions */ #define MCL_HIGHEST_LAYER 255 /* used by add/drop functions */ /* * tx/rx modes * differentiate application mode and signalization mode (usually piggy-backed) */ #define MODE_UNI_TX 0x01 /* can send in unicast */ #define MODE_MCAST_TX 0x02 /* can send in multicast */ #define MODE_UNI_RX 0x04 /* can receive in unicast */ #define MODE_MCAST_RX 0x08 /* can receive in multicast */ /* SIG currently only used by ODL but */ #define MODE_SIG_UNI_TX 0x10 /* can send signaling in unicast */ #define MODE_SIG_UNI_RX 0x20 /* can recv signaling in unicast */ /* * How many times should we transmit each kind of signalization information * (for increased reliability) ? Tx for ever if value is -1. * NB: for CLOSE the nb of tx must be > 0 (10 times seems ok) */ #define MAX_TX_SIG_NONEWADU -1 #define MAX_TX_SIG_CLOSE 10 #endif /* } MCL_H */