Server.py – Server¶
Server class that simualtes a server behaving as defined in the AUTOSAT standard. Each server instance is executed as a single process.
Classes¶
Server¶
-
class
Server.Server(config, q, writer, clientQueues, attackers, stopQueue, verbose=False)[source]¶ Initialization of the server object.
Parameters: - config – Own server configuration.
- q – Own queue for receiving messages from clients.
- writer – Queue for writing out a packet.
- clientQueues – Queues of all available clients.
- attackers – Attacker Queue as the attacker is implemented as MitM.
- stopQueues – A DONE is sent to this queue if on q a DONE is received.
- verbose – If set to True, more output is printed, default=False
Functions¶
server¶
msgTypeSupported¶
checkServiceAndMethodKnown¶
requestedMethodIsRequest¶
generateRandomReply¶
sendReply¶
-
Server.sendReply(msgType, msgRet, client, reply, timestamp, s)[source]¶ Putting everything together and send the reply/error.
Parameters: - msgType – The used message type for the reply.
- msgRet – The used return/error code for the reply.
- client – The client the message is sent to.
- reply – The content of the reply.
- timestamp – The timestamp that shall be used.
- s – Own server instance.