Pregunta de protocolos

Topología de redes, usos de las redes...

Moderador: Moderadores

Pregunta de protocolos

Notapor Narciso » Dom Dic 13, 2015 10:29 pm

Hola,
antes que nada les dejo el protocolo y en los comentarios las preguntas:

Code: [Select]
2 bytes -> data length
1 byte -> proto id
x bytes -> data


Ares Chatroom Protocol - Ares 2.1.7.3041 implementation:

Code: [Select]
Proto ID: MSG_CHAT_SERVER_ERROR (0)
Direction: server to client
Function: make client display error message and then disconnect

x bytes -> error message

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_RELOGIN (1)
Direction: client to server
Function: login and automatically set keepalive flag

Same packet layout as MSG_CHAT_CLIENT_LOGIN

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_LOGIN (2)
Direction: client to server
Function: login handshake packet when first joining a room

16 bytes -> guid
2 bytes -> file count
1 byte -> null
2 bytes -> data port
4 bytes -> node ip address
2 bytes -> node port
4 bytes -> null * 4
x bytes -> user name
1 byte -> null
x bytes -> client version
1 byte -> null
4 bytes -> local ip address
4 bytes -> external ip address
1 byte -> client features
1 byte -> current uploads
1 byte -> maximum uploads allowed
1 byte -> current queued users
1 byte -> user age
1 byte -> user gender
1 byte -> user country code
x bytes -> user location
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_SERVER_LOGIN_ACK (3)
Direction: server to client
Function: server tells client that they have logged in successfully

x bytes -> the user name allocated to you
1 byte -> null
x bytes -> the current name of the chatroom
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_UPDATE_STATUS (4)
Direction: client to server
Function: client sends this every few minutes to keep connection alive

2 bytes -> file count
1 byte -> client features
4 bytes -> node ip address
2 bytes -> node port
4 bytes -> external ip address
1 byte -> client features
1 byte -> current uploads
1 byte -> maximum uploads allowed
1 byte -> current queued users
1 byte -> user age
1 byte -> user gender
1 byte -> user country code
x bytes -> user location
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_SERVER_UPDATE_USER_STATUS (5)
Direction: server to client
Function: server tells users that user details have changed

x bytes -> user name
1 byte -> null
2 bytes -> file count
1 byte -> browsable status
4 bytes -> node ip address
2 bytes -> node port
4 bytes -> external ip address
1 byte -> admin level
1 byte -> user age
1 byte -> user gender
1 byte -> user country code
x bytes -> user location
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_SERVER_REDIRECT (6)
Direction: server to client
Function: send a client to a different chatroom

4 bytes -> new room external ip address
2 bytes -> new room port
4 bytes -> new room local ip address
x bytes -> new room name
1 byte -> null
x bytes -> reason for redirecting
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_AUTOLOGIN (7)
Direction: client to server
Function: secure admin login

20 bytes -> SHA1 hash
(
20 bytes -> SHA1 hash
(
x bytes -> password
)
4 bytes -> server external ip address
4 bytes -> the admin cookie allocated to you
)

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_AVATAR (9)
Direction: client to server
Function: upload your avatar

x bytes -> 48x48 sized image as JPEG

Code: [Select]
Proto ID: MSG_CHAT_SERVER_AVATAR (9)
Direction: server to client
Function: update a user's avatar for everyone

x bytes -> user name
1 byte -> null
x bytes -> 48x48 sized image as JPEG

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_PUBLIC (10)
Direction: client to server
Function: upload a message to the server

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_PUBLIC (10)
Direction: server to client
Function: send a received message to clients

x bytes -> user name
1 byte -> null
x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_EMOTE (11)
Direction: client to server
Function: upload a purple message to the server

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_EMOTE (11)
Direction: server to client
Function: send a received purple message to clients

x bytes -> user name
1 byte -> null
x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_PERSONALMESSAGE (13)
Direction: client to server
Function: upload your personal message to the server

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_PERSONALMESSAGE (13)
Direction: server to client
Function: update a user's personal message for everyone

x bytes -> user name
1 byte -> null
x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_FASTPING (14)
Direction: client to server
Function: fast ping users send this every few seconds if supported

empty

Code: [Select]
Proto ID: MSG_CHAT_SERVER_FASTPING (14)
Direction: server to client
Function: reply to client fastping packet

empty

Code: [Select]
Proto ID: MSG_CHAT_SERVER_JOIN (20)
Direction: server to client
Function: server sends green join message

2 bytes -> file count
4 bytes -> null * 4
4 bytes -> external ip
2 bytes -> data port
4 bytes -> node ip
2 bytes -> node port
1 byte -> null
x bytes -> user name
1 byte -> null
4 bytes -> local ip
1 byte -> browsable status
1 byte -> admin level
1 byte -> age
1 byte -> gender
1 byte -> country code
x byte -> user location
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_SERVER_PART (22)
Direction: server to client
Function: server sends orange part message

x bytes -> user name

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_PVT (25)
Direction: client to server
Function: client uploads a private message

x bytes -> target user name
1 byte -> null
x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_PVT (25)
Direction: server to client
Function: server sends an uploaded private message

x bytes -> sender user name
1 byte -> null
x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_ISIGNORINGYOU (26)
Direction: server to client
Function: message when you PM a user who ignored you

x bytes -> sender user name

Code: [Select]
Proto ID: MSG_CHAT_SERVER_OFFLINEUSER (27)
Direction: server to client
Function: message when you PM a user who is no longer connected

x bytes -> sender user name

Code: [Select]
Proto ID: MSG_CHAT_SERVER_CHANNEL_USER_LIST (30)
Direction: server to client
Function: userlist item when you first join a room

same as MSG_CHAT_SERVER_JOIN

Code: [Select]
Proto ID: MSG_CHAT_SERVER_TOPIC (31)
Direction: server to client
Function: new topic message

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_TOPIC_FIRST (32)
Direction: server to client
Function: topic message received when you join a room

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_CHANNEL_USER_LIST_END (35)
Direction: server to client
Function: userlist items finished sending

1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_SERVER_NOSUCH (44)
Direction: server to client
Function: red announce message

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_IGNORELIST (45)
Direction: client to server
Function: add/remove a user to/from your ignore list

1 byte -> add/remove
x bytes -> target user name

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_ADDSHARE (50)
Direction: client to server
Function: upload a browse item

1 byte -> mime type
4 bytes -> file length
2 bytes -> length of search words
x bytes -> search words

// file data --->
15 bytes -> SHA1 hash (range 1 to 16)
x bytes -> params
2 bytes -> length of details
x bytes -> details
// <--- file data

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_REMSHARE (51)
Direction: client to server
Function: remove a browse item

4 bytes -> size of file(s) to be removed

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_BROWSE (52)
Direction: client to server
Function: request browse of someone's shared files

2 bytes -> browse id
1 byte -> mime
x bytes -> target user name

Code: [Select]
Proto ID: MSG_CHAT_SERVER_ENDOFBROWSE (53)
Direction: server to client
Function: all browse items have been sent

2 bytes -> browse id

Code: [Select]
Proto ID: MSG_CHAT_SERVER_BROWSEERROR (54)
Direction: server to client
Function: cancelled browse session

2 bytes -> browse id

Code: [Select]
Proto ID: MSG_CHAT_SERVER_BROWSEITEM (55)
Direction: server to client
Function: browse item sent to client

2 bytes -> browse id
1 byte -> mime
4 bytes -> file size
x bytes -> file data

Code: [Select]
Proto ID: MSG_CHAT_SERVER_STARTOFBROWSE (56)
Direction: server to client
Function: browse session begins

2 bytes -> browse id
2 bytes -> browse items to be sent

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_SEARCH (60)
Direction: client to server
Function: request a search of everyone's shared files

2 bytes -> search id
1 byte -> null
1 byte -> mime
2 bytes -> length of search words
x bytes -> search words

Code: [Select]
Proto ID: MSG_CHAT_SERVER_SEARCHHIT (61)
Direction: server to client
Function: search result item

2 bytes -> search id
1 byte -> mime
4 bytes -> file data
4 bytes -> external ip
2 bytes -> port
4 bytes -> node ip
2 bytes -> node port
4 bytes -> local ip
1 byte -> current upload count
1 byte -> maximum uploads allowed
1 byte -> current queued users
1 byte -> 0x01

Code: [Select]
Proto ID: MSG_CHAT_SERVER_ENDOFSEARCH (62)
Direction: server to client
Function: search items finished being sent

2 bytes -> search id

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_DUMMY (64)
Direction: client to server
Function: proxy server keep alive

empty

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_SEND_SUPERNODES (70)
Direction: client to server
Function: request a list of reliable nodes

empty

Code: [Select]
Proto ID: MSG_CHAT_SERVER_HERE_SUPERNODES (70)
Direction: server to client
Function: receive a list of reliable nodes

while (remaining_data >= 6)
{
4 bytes -> node ip
2 bytes -> node port
}

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_DIRCHATPUSH (72)
Direction: client to server
Function: request help initialising a direct chat session

x bytes -> target user name
1 byte -> null
16 bytes -> direct chat session guid

Code: [Select]
Proto ID: MSG_CHAT_SERVER_DIRCHATPUSH (72)
Direction: server to client
Function: direct chat push response

either:

1 byte -> direct chat error code

or:

x bytes -> target name
1 byte -> null
4 bytes -> target external ip
2 bytes -> target port
4 bytes -> target local ip
16 bytes -> direct chat session guid

Code: [Select]
Proto ID: MSG_CHAT_SERVER_URL (73)
Direction: server to client
Function: update the url tag

x bytes -> URL
1 byte -> null
x bytes -> message
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_COMMAND (74)
Direction: client to server
Function: send an admin command to the server

x bytes -> message

Code: [Select]
Proto ID: MSG_CHAT_SERVER_OPCHANGE (75)
Direction: server to client
Function: set right click userlist menu for a user

1 byte -> include admin options
1 byte -> null

Code: [Select]
Proto ID: MSG_CHAT_CLIENTCOMPRESSED (80)
Direction: client to server
Function: client sends compressed data to the server

x bytes -> compressed data

Code: [Select]
Proto ID: MSG_CHAT_CLIENTCOMPRESSED (80)
Direction: server to client
Function: server sends compressed data to the client

x bytes -> compressed data

Code: [Select]
Proto ID: MSG_CHAT_CLIENT_AUTHLOGIN (82)
Direction: client to server
Function: unsecure admin login

x bytes -> password

Code: [Select]
Proto ID: MSG_CHAT_SERVER_MYFEATURES (92)
Direction: server to client
Function: server sends joining user chatroom credentials

x bytes -> server version
1 byte -> null
1 byte -> client features supported
1 byte -> mime types supported
1 byte -> default language
4 bytes -> admin cookie
1 byte -> avatar support

Gracias y saludos
Narciso
:-D
:-D
 
Mensajes: 192
Registrado: Mar May 12, 2015 5:41 pm

Re: Pregunta de protocolos

Notapor Narciso » Dom Dic 13, 2015 10:30 pm

En el protocolo ID MSG_CHAT_CLIENT_RELOGIN ...
Yo entro.. y que hago despues? Que es set keepalive flag?

En el protocolo ID MSG_CHAT_CLIENT_LOGIN ...
Que hago aqui con el paquete handshake?

Que pasa en los siguientes protocolos?
MSG_CHAT_CLIENT_UPDATE_STATUS
MSG_CHAT_CLIENT_AVATAR
MSG_CHAT_CLIENT_PUBLIC
MSG_CHAT_SERVER_PUBLIC
MSG_CHAT_CLIENT_EMOTE
MSG_CHAT_CLIENT_DUMMY
MSG_CHAT_CLIENT_SEND_SUPERNODES
MSG_CHAT_CLIENTCOMPRESSED
Narciso
:-D
:-D
 
Mensajes: 192
Registrado: Mar May 12, 2015 5:41 pm


Volver a Redes

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados