| 1 | /********************************************************************* |
| 2 | * |
| 3 | * AUTHORIZATION TO USE AND DISTRIBUTE |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that: |
| 7 | * |
| 8 | * (1) source code distributions retain this paragraph in its entirety, |
| 9 | * |
| 10 | * (2) distributions including binary code include this paragraph in |
| 11 | * its entirety in the documentation or other materials provided |
| 12 | * with the distribution, and |
| 13 | * |
| 14 | * (3) all advertising materials mentioning features or use of this |
| 15 | * software display the following acknowledgment: |
| 16 | * |
| 17 | * "This product includes software written and developed |
| 18 | * by Brian Adamson and Joe Macker of the Naval Research |
| 19 | * Laboratory (NRL)." |
| 20 | * |
| 21 | * The name of NRL, the name(s) of NRL employee(s), or any entity |
| 22 | * of the United States Government may not be used to endorse or |
| 23 | * promote products derived from this software, nor does the |
| 24 | * inclusion of the NRL written and developed software directly or |
| 25 | * indirectly suggest NRL or United States Government endorsement |
| 26 | * of this product. |
| 27 | * |
| 28 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 29 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 30 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 31 | ********************************************************************/ |
| 32 | |
| 33 | #ifndef _MGEN_GLOBALS |
| 34 | #define _MGEN_GLOBALS |
| 35 | |
| 36 | enum LogEventType |
| 37 | { |
| 38 | INVALID_EVENT = 0, |
| 39 | RECV_EVENT, |
| 40 | RERR_EVENT, |
| 41 | SEND_EVENT, |
| 42 | LISTEN_EVENT, |
| 43 | IGNORE_EVENT, |
| 44 | JOIN_EVENT, |
| 45 | LEAVE_EVENT, |
| 46 | START_EVENT, |
| 47 | STOP_EVENT, |
| 48 | ON_EVENT, |
| 49 | ACCEPT_EVENT, |
| 50 | DISCONNECT_EVENT, |
| 51 | CONNECT_EVENT, |
| 52 | OFF_EVENT, |
| 53 | SHUTDOWN_EVENT, |
| 54 | RECONNECT_EVENT |
| 55 | |
| 56 | }; |
| 57 | |
| 58 | /** |
| 59 | * Possible protocol types |
| 60 | */ |
| 61 | enum Protocol |
| 62 | { |
| 63 | INVALID_PROTOCOL, |
| 64 | UDP, |
| 65 | TCP, |
| 66 | SINK, |
| 67 | SOURCE // pseudo transport type so an mgen can have distinct source/sink transports |
| 68 | }; |
| 69 | |
| 70 | enum |
| 71 | { |
| 72 | MIN_SIZE = 28, |
| 73 | MAX_SIZE = 8192, |
| 74 | MSG_LEN_SIZE = 2, |
| 75 | // TX_BUFFER_SIZE is the tcp tx buffer size, for now same as udp max_size |
| 76 | TX_BUFFER_SIZE = 8192, |
| 77 | MAX_FRAG_SIZE = 65535, // TCP max fragment size |
| 78 | MIN_FRAG_SIZE = 76 // ljt what should this be? |
| 79 | // we're going with IPV6 + gps max for now |
| 80 | }; |
| 81 | enum FragmentationStatus |
| 82 | { |
| 83 | // We pass df to protoSockets setFragmentation() method which |
| 84 | // reverses the bit setting. |
| 85 | |
| 86 | DF_ON, // setFragmentation(false) = do not allow fragmentation set DF bit OFF |
| 87 | DF_OFF, // setFragmentation(true) = allow fragmentation set DF bit ON |
| 88 | DF_DEFAULT // leave socket DF option in its default state |
| 89 | |
| 90 | }; |
| 91 | |
| 92 | enum MessageStatus |
| 93 | { |
| 94 | MSG_SEND_FAILED, |
| 95 | MSG_SEND_BLOCKED, |
| 96 | MSG_SEND_OK |
| 97 | |
| 98 | }; |
| 99 | |
| 100 | #endif // _MGEN_GLOBALS |