switch (packet_opcode) {
case OP_PEERHELLO: {
byte[] data = new byte[16];
packet_data.get(); // skip user hash's length
packet_data.get(data);
UserHash userHash = new UserHash(data);
byte client_id[] = new byte[4];
packet_data.get(client_id);
ClientID clientID = new ClientID(client_id);
int tcpPort = Convert.shortToInt(packet_data.getShort());
TagList tag_list = readTagList(packet_data);
byte[] server_ip_array = new byte[4];
packet_data.get(server_ip_array);
String server_ip = Convert.IPtoString(server_ip_array);
int server_port;
server_port = Convert.shortToInt(packet_data.getShort());
_network_manager.receivedHelloFromPeerAndRespondTo(peerIP,
peerPort, userHash, clientID, tcpPort, tag_list,
server_ip, server_port);
break;
}
case OP_PEERHELLOANSWER: {
byte[] data = new byte[16];
packet_data.get(data);
UserHash userHash = new UserHash(data);
byte client_id[] = new byte[4];
packet_data.get(client_id);
ClientID clientID = new ClientID(client_id);