conexus/enums.h

00001 /***************************************************************************
00002 *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003 *   rvinyard@cs.nmsu.edu                                                  *
00004 *                                                                         *
00005 *   This program is free software; you can redistribute it and/or modify  *
00006 *   it under the terms of the GNU Lesser General Public License as        *
00007 *   published by the Free Software Foundation version 2.1.                *
00008 *                                                                         *
00009 *   This program is distributed in the hope that it will be useful,       *
00010 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012 *   GNU General Public License for more details.                          *
00013 *                                                                         *
00014 *   You should have received a copy of the GNU Lesser General Public      *
00015 *   License along with this library; if not, write to the                 *
00016 *   Free Software Foundation, Inc.,                                       *
00017 *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018 ***************************************************************************/
00019 #ifndef CONEXUSENUMS_H
00020 #define CONEXUSENUMS_H
00021 
00022 #include <netinet/ip.h>
00023 #include <termios.h>
00024 
00025 namespace Conexus {
00026 
00030   typedef enum EndpointState {
00031     ENDPOINT_NOSTATE   = 0,
00032     ENDPOINT_CLOSED    = 1<<0,    
00033     ENDPOINT_OPENED    = 1<<1,   
00034     ENDPOINT_LAST_STATE  = ENDPOINT_OPENED,
00035     ENDPOINT_UNCHANGED = ~0, 
00036   } EndpointState;
00037 
00041   typedef enum SocketState {
00042     SOCKET_BOUND     = ENDPOINT_LAST_STATE << 1,  
00043     SOCKET_CONNECTED = ENDPOINT_LAST_STATE << 2,  
00044     SOCKET_LISTENING = ENDPOINT_LAST_STATE << 3,  
00045     SOCKET_ACCEPTED  = ENDPOINT_LAST_STATE << 4,  
00046     SOCKET_LAST_STATE  = SOCKET_ACCEPTED,
00047   } SocketState;
00048 
00049   typedef enum SerialMode {
00050     SERIAL_READ=1<<0,
00051     SERIAL_WRITE=1<<1,
00052     SERIAL_UNCHANGED=1<<2,
00053   } SerialMode;
00054 
00055   typedef enum PipeMode {
00056     PIPE_READ=ENDPOINT_LAST_STATE<<1,           
00057     PIPE_WRITE=ENDPOINT_LAST_STATE<<2,            
00058   } PipeMode;
00059 
00060   typedef enum FileMode {
00061     FILE_READ=1<<0,
00062     FILE_WRITE=1<<1,
00063     FILE_APPEND=1<<2,
00064     FILE_CREATE=1<<3,
00065     FILE_DIRECT=1<<4,
00066     FILE_LARGE_FILE=1<<5,
00067     FILE_NO_ACCESS_TIME=1<<6,
00068     FILE_NO_FOLLOW=1<<7,
00069     FILE_TRUNCATE=1<<8,
00070     FILE_EXCLUSIVE_CREATE=1<<9,
00071     FILE_UNCHANGED=1<<10,
00072   } FileMode;
00073 
00074   typedef enum QueueMode {
00075     QUEUE_READ=1<<0,
00076     QUEUE_WRITE=1<<1,
00077     QUEUE_CREATE=1<<2,
00078     QUEUE_EXCLUSIVE_CREATE=1<<3,
00079     QUEUE_NONBLOCKING=1<<4,
00080     QUEUE_UNCHANGED=1<<5,
00081   } QueueMode;
00082 
00083   typedef enum TOS {
00084     TOS_LOWDELAY = IPTOS_LOWDELAY,       
00085     TOS_THROUGHPUT = IPTOS_THROUGHPUT,   
00086     TOS_RELIABILITY = IPTOS_RELIABILITY, 
00087     TOS_LOWCOST = IPTOS_LOWCOST,         
00088   } TOS;
00089 
00093   typedef enum SetOption {
00095     SET_NOW = TCSANOW,
00096 
00102     SET_FLUSH = TCSAFLUSH,
00103 
00108     SET_DRAIN = TCSADRAIN
00109   } SetOption;
00110 
00111   typedef enum Parity {
00112     PARITY_NONE,  
00113     PARITY_ODD,   
00114     PARITY_EVEN,  
00115   } Parity;
00116 
00117   typedef enum ParityError {
00118     PARITY_ERROR_DISCARD,  
00119     PARITY_ERROR_MARK,     
00120     PARITY_ERROR_ZERO,     
00121     PARITY_ERROR_IGNORE,   
00122   } ParityError;
00123 
00124   typedef enum FlowControl {
00125     FLOW_NONE,  
00126     FLOW_HARDWARE,  
00127     FLOW_SOFTWARE,  
00128     FLOW_CUSTOM,  
00129   } FlowControl;
00130 
00131 
00132 }
00133 
00134 #endif

Generated on Tue Mar 13 19:54:43 2007 by  doxygen 1.5.1