conexus logo

enums.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the conexus library.                             *
00006  *                                                                         *
00007  *   The conexus library is free software; you can redistribute it and/or  *
00008  *   modify it under the terms of the GNU General Public License           *
00009  *   version 3 as published by the Free Software Foundation.               *
00010  *                                                                         *
00011  *   The conexus library is distributed in the hope that it will be        *
00012  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty   *
00013  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014  *   General Public License for more details.                              *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this software. If not see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 #ifndef CONEXUSENUMS_H
00020 #define CONEXUSENUMS_H
00021 
00022 #include <netinet/ip.h>
00023 #include <termios.h>
00024 
00025 namespace Conexus {
00026 
00027   typedef enum ReadWrite {
00028     READ_WRITE_NONE=0,
00029     READ=1,
00030     WRITE=2,
00031     READ_WRITE=3,
00032     READ_WRITE_UNCHANGED=4,
00033     READ_WRITE_LAST_STATE=READ_WRITE_UNCHANGED
00034   } ReadWrite;
00035 
00040   typedef enum EndpointState {
00041     ENDPOINT_NOSTATE   = 0,
00042     ENDPOINT_CLOSED    = 1<<0,    
00043     ENDPOINT_OPENED    = 1<<1,   
00044     ENDPOINT_LAST_STATE  = ENDPOINT_OPENED,
00045     ENDPOINT_UNCHANGED = ~0, 
00046   } EndpointState;
00047 
00055   typedef enum StartStop {
00056     STOP=0, 
00057     START=1,
00058   } StartStop;
00059   
00064   typedef enum SocketState {
00065     SOCKET_BOUND     = ENDPOINT_LAST_STATE << 1,  
00066     SOCKET_CONNECTED = ENDPOINT_LAST_STATE << 2,  
00067     SOCKET_LISTENING = ENDPOINT_LAST_STATE << 3,  
00068     SOCKET_ACCEPTED  = ENDPOINT_LAST_STATE << 4,  
00069     SOCKET_LAST_STATE  = SOCKET_ACCEPTED,
00070   } SocketState;
00071 
00075   typedef enum PipeMode {
00076     PIPE_READ=ENDPOINT_LAST_STATE<<1,           
00077     PIPE_WRITE=ENDPOINT_LAST_STATE<<2,            
00078   } PipeMode;
00079 
00083   typedef enum FileMode {
00084     FILE_READ=1<<0,
00085     FILE_WRITE=1<<1,
00086     FILE_APPEND=1<<2,
00087     FILE_CREATE=1<<3,
00088     FILE_DIRECT=1<<4,
00089     FILE_LARGE_FILE=1<<5,
00090     FILE_NO_ACCESS_TIME=1<<6,
00091     FILE_NO_FOLLOW=1<<7,
00092     FILE_TRUNCATE=1<<8,
00093     FILE_EXCLUSIVE_CREATE=1<<9,
00094     FILE_UNCHANGED=1<<10,
00095     FILE_LAST_STATE=FILE_UNCHANGED,
00096   } FileMode;
00097 
00101   typedef enum QueueMode {
00102     QUEUE_READ=1<<0,
00103     QUEUE_WRITE=1<<1,
00104     QUEUE_CREATE=1<<2,
00105     QUEUE_EXCLUSIVE_CREATE=1<<3,
00106     QUEUE_NONBLOCKING=1<<4,
00107     QUEUE_UNCHANGED=1<<5,
00108   } QueueMode;
00109 
00113   typedef enum TOS {
00114     TOS_LOWDELAY = IPTOS_LOWDELAY,       
00115     TOS_THROUGHPUT = IPTOS_THROUGHPUT,   
00116     TOS_RELIABILITY = IPTOS_RELIABILITY, 
00117     TOS_LOWCOST = IPTOS_LOWCOST,         
00118   } TOS;
00119 
00124   typedef enum SetOption {
00126     SET_NOW = TCSANOW,
00127 
00133     SET_FLUSH = TCSAFLUSH,
00134 
00139     SET_DRAIN = TCSADRAIN
00140   } SetOption;
00141 
00145   typedef enum Parity {
00146     PARITY_NONE,  
00147     PARITY_ODD,   
00148     PARITY_EVEN,  
00149   } Parity;
00150 
00154   typedef enum ParityError {
00155     PARITY_ERROR_DISCARD,  
00156     PARITY_ERROR_MARK,     
00157     PARITY_ERROR_ZERO,     
00158     PARITY_ERROR_IGNORE,   
00159   } ParityError;
00160 
00164   typedef enum FlowControl {
00165     FLOW_NONE,  
00166     FLOW_HARDWARE,  
00167     FLOW_SOFTWARE,  
00168     FLOW_CUSTOM,  
00169   } FlowControl;
00170 
00171 }
00172 
00173 #endif

Generated on Wed Jul 8 15:50:07 2009 for conexus by doxygen 1.5.8