This repository was archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConstants.py
More file actions
180 lines (137 loc) · 2.8 KB
/
Copy pathConstants.py
File metadata and controls
180 lines (137 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#***************************************
# FileName: Constants.py
#
# Description:
# This file contains the constants used by
# the rest of the program.
#
#****************************************
#Run using blacklist or whitelist
useBlackList = False
#The interface on which the progam will run
theInterface = "eth1"
#Channel
channel = "11"
#Essid
essid = "YOBATMAN"
#The type code for OGM packets
theOGMType = 0x3123
#The type code for Message Packets
theMessageType = 0x3122
#The broadcast address
BROADCAST = "\xFF" * 6
#Time to live value for packets
ttl_value = 5
#Time between sending OGM packets
timeBetweenOGM = 3
#Note: There also could be up to
maxRandomTimeBetweenOGM = 2
#seconds between OGM messages
#Verbose Mode ON/OFF
verbose = True
#Socket TimeOut
socketTimeout = 0
#if 0, the socket is non-blocking
#Sequence Number Start
sequenceNumberStart = 1000
#Recv Packet Size
packetSizeRecv = 2048
#Queue Size
QueueSize = 0
#Here, 0 means queues of infinite size
#QueueWait
QueueWait = 0
#Here, 0 means non-blocking
#Command Messages
#View --> ViewController
ViewExit = "ViewExit"
NodeOn = "NodeOn"
NodeOff = "NodeOff"
EditBlackList = "EditBlackList"
NewMessageEditor = "NewMessageEditor"
NewBlackList = "NewBlackList"
def isNewBlackList(thing):
try:
if thing[0] == NewBlackList:
return True
else:
return False
except:
return False
#PacketManager ->>
MyAddressIs = "MyAddressIs"
ResetRoutingTable = "ResetRoutingTable"
def isAddressMessage(thing):
try:
if thing[0] == MyAddressIs:
return True
else:
return False
except:
return False
NewProcessedPacket = "NewProcessedPacket"
def isProcessedPacket(thing):
try:
if thing[0] == NewProcessedPacket:
return True
else:
return False
except:
return False
#OGMProcessor ->>
OGMMessage = "OGMMessage"
def isOGMMessage(thing):
try:
if thing[0] == OGMMessage:
return True
else:
return False
except:
return False
#Message Processor ->>
MessMessage = "MessMessage"
def isMessMessage(thing):
try:
if thing[0] == MessMessage:
return True
else:
return False
except:
return False
#DataStorage ->>
UpdatedRoutingTable = "UpdatedRoutingTable"
def isUpdatedRoutingTable(thing):
try:
if thing[0] == UpdatedRoutingTable:
return True
else:
return False
except:
return False
ReturnEditBlackList = "ReturnEditBlackList"
def isReturnEditBlackList(thing):
try:
if thing[0] == ReturnEditBlackList:
return True
else:
return False
except:
return False
ConnectedNodes = "ConnectedNodes"
def isConnectedNodes(thing):
try:
if thing[0] == ConnectedNodes:
return True
else:
return False
except:
return False
ReturnNewMessage = "ReturnNewMessage"
def isReturnNewMessage(thing):
try:
if thing[0] == ReturnNewMessage:
return True
else:
return False
except:
return False