diff --git a/central-manager/lib/local/middleware.c b/central-manager/lib/local/middleware.c index 950a207..5b8bb67 100644 --- a/central-manager/lib/local/middleware.c +++ b/central-manager/lib/local/middleware.c @@ -23,6 +23,7 @@ int multicastTerminal(struct middleware_arg* arg){ int read; // compteurs char buffer[MAX_BUF_LEN+1]; // buffer requête struct bind_header request; // requête parsée + struct in_addr ip; // Pour afficher une ip en dot notation /* 2. On récupère l'IP locale */ struct in_addr* SERV_IP = GET_LOCAL_IP(); @@ -52,7 +53,9 @@ int multicastTerminal(struct middleware_arg* arg){ memcpy(&request.flags, buffer, sizeof(char)); memcpy(&request.addr, buffer+sizeof(char), sizeof(in_addr_t)); memcpy(&request.port, buffer+sizeof(char)+sizeof(in_addr_t), sizeof(unsigned short)); - printf("{%s} received: bind_header{flag = %d; addr = %x; port = %d}\n", arg->entity, (int) request.flags, ntohl(request.addr), request. port); + request.addr = ntohl(request.addr); + ip.s_addr = request.addr; + printf("{%s} received: bind_header{flag = %d; addr = %x/'%s'; port = %d}\n", arg->entity, (int) request.flags, ntohl(request.addr), inet_ntoa(ip), request. port); /* 2. Si mauvais flag (avion) */ if( request.flags&BINDHEAD_TCP || !(request.flags&BINDHEAD_UDP) ){