Crocodile protocols


I. Alligator side:

Receive
or send
Data typeData labelData valueAction after send or recieve and notes
1outByteWelcome'+'-
2inString1Login--
3inStringPassword--
4outByteResultsee below-
4outByteResult'!'Go ahead.
4outByteResult'^'Login failed, terminate conversation.
5inByteAction-Conversation depends on this byte.
5inByteAction'a'Add user.
5.1inStringUser--
5.2inStringGecos--
5.3inIntegerTime--
5.4inIntegerTraffic--
5.5inIntegerDrop flg--
5.6inIntegerDelete flg--
5.7outByteResultsee belowTerminate after.
5.7outByteResult'+'User added.
5.7outByteResult'-'Duplicate name.
5.7outByteResult'*'User not added. Error.
5.7outByteResult'~'No rights to do this.
5inByteAction's'Set user.
5.1inStringUser--
5.2inIntegerTime--
5.3inIntegerTraffic--
5.4inIntegerDrop flg--
5.5inIntegerDelete flg--
5.6outByteResultsee belowTerminate.
5.6outByteResult'+'User set.
5.6outByteResult'-'No such user.
5.6outByteResult'*'User not set. Error.
5.6outByteResult'~'No rights to do this.
5inByteAction'g'Get user
5.1inStringUser--
5.2outByteResultsee below-
5.2outByteResult'+'OK.
5.2outByteResult'-'No such user.
5.2outByteResult'*'Error.
5.2outByteResult'~'No rights to do this.
5.3outIntegerTime--
5.4outIntegerTraffic--
5.5outIntegerFlags--
5.6outIntegerTime-Current time.
5.7outIntegerTraffic-Current traffic.
5inByteAction'd'Delete user.
5.1inStringUser--
5.2outByteResultsee belowTerminate after.
5.2outByteResult'+'User deleted.
5.2outByteResult'-'No such user.
5.2outByteResult'*'User not deleted. Error.
5.2outByteResult'~'No rights to do this.
5inByteAction'i'Log in.
5.1inStringDevice--
5.2inStringHost--
5.3outByteResultsee belowTerminate.
5.3outByteResult'+'User logged on.
5.3outByteResult'-'No account.
5.3outByteResult'*'Error.
5.3outByteResult'~'Account expired.
5.3outByteResult'.'Already logged on.
5inByteAction'{'Trusted2 log in.
5.1inStringDevice--
5.2inStringHost--
5.3outByteResultsee belowTerminate.
5.3outByteResult'+'User logged on.
5.3outByteResult'-'No account.
5.3outByteResult'*'Error.
5.3outByteResult'~'Account expired.
5.3outByteResult'.'Already logged on.
5inByteAction'o'Log out.
5.1inStringDevice--
5.2inStringHost--
5.3outByteResultsee belowTerminate.
5.3outByteResult'+'User logged out.
5.3outByteResult'-'User not logged.
5.3outByteResult'*'Error.
5inByteAction'}'Trusted log out.
5.1inStringDevice--
5.2inStringHost--
5.3outByteResultsee belowTerminate.
5.3outByteResult'+'User logged out.
5.3outByteResult'-'User not logged.
5.3outByteResult'*'Error.
5inByteAction'u'Dump users.
5.1inStringUser3--
5.2outIntegerPages-0 if no such user.
5.3inIntegerPage--
5.4outStringUser name-Empty string if no more users or error. After empty string - terminate.
5.5outIntegerTime--
5.6outIntegerTraffic--
5.7outIntegerFlags--
5.8inByteAction'>'Next record. Loop to 5.4.
5inByteAction'c'Dump current.
5.1outStringUser name-Empty string if no more users or error. After empty string - terminate.
5.2outStringDevice--
5.3outStringHost--
5.4outIntegerStart time--
5.5outIntegerFinal time--
5.6outIntegerFinal < tr--
5.7outIntegerFinal > rt--
5.8inByteAction'>'Next record. Loop to 5.1.
5inByteAction'h'Dump hrono.
5.1inStringUser**--
5.2inIntegerStart time--1 if no matter.
5.3inIntegerFinal time--1 if no matter.
5.4outStringUser name-Empty string if no more users or error. After empty string - terminate.
5.5outStringDevice--
5.6outStringHost--
5.7outIntegerStart time--
5.8outIntegerFinal time--
5.9outIntegerLogin time--
5.10outInteger< traffic--
5.11outInteger> traffic--
5.12outIntegertraffic--
5.13inByteAction'>'Next record. Loop to 5.4.
6outByteResultsee below-
6outByteResult'#'Good bye, terminate.
6outByteResult'?'Invalid action, terminate.

I. Mugger side:

Receive
or send
Data typeData labelData valueAction after send or recieve and notes
1outByteWelcome'+'-
2inStringLogin--
3inStringDevice--
4inStringHost--
5outByteResultsee belowTerminate.
5outByteResult'+'User killed.
5outByteResult'-'No such user.
5outByteResult'*'User not killed. Error.

1 NULL Terminated string.
2 Password for trusted login is "@login@" and for trusted logout - "@logout".
3 Empty string means all users.