Browse Source

Correction du commit précédent (on changeait le mauvais argument).

master
Stéphane 7 years ago
parent
commit
6267c1caec
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      node.c

+ 6
- 7
node.c View File

@@ -437,25 +437,24 @@ int is_uint32(char *str) {
}

int main(int argc, char **argv) {
if (argc < 6 || !is_ushort(argv[2]) || !is_ushort(argv[3]) || !is_uint32(argv[4]) || !is_ushort(argv[5])) {
uint32_t id;

if (argc < 6 || !is_ushort(argv[2]) || !is_ushort(argv[3]) || !char_hexa_to_uint32(argv[4], &id) || !is_ushort(argv[5])) {
puts("parms: <next node IP> <next node port> <our node port> <our ID> <subscribe port> ");
return 1;
}

uint32_t id;
char_hexa_to_uint32(argv[5], &id);

/* threads de la couche 1, transmission de la trame */
struct layer1_parm_t layer1_parm;
layer1_parm.next_node_ip = inet_addr(argv[1]);
layer1_parm.next_node_port = htons(atoi(argv[2]));
layer1_parm.node_port = htons(atoi(argv[3]));
layer1_parm.node_address = atoi(argv[4]);
layer1_parm.node_address = id;

printfdbg("Subscribe port: %d\n", id);
printfdbg("Subscribe port: %d\n", atoi(argv[5]));

/* Initialisation de la liste d'inscriptions */
list_subscription_init(&list_subscription, id);
list_subscription_init(&list_subscription, atoi(argv[5]));

pthread_t layer1_thread; /* réception/réémission trame */
pthread_create(&layer1_thread, NULL, layer1_frame, &layer1_parm);


Loading…
Cancel
Save