Commit 63e90550 authored by Aurelio Colosimo's avatar Aurelio Colosimo

next_delay handled with a default value

parent 18deb6e0
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#define PP_PDELAY_RESP_FOLLOW_UP_LENGTH 54 #define PP_PDELAY_RESP_FOLLOW_UP_LENGTH 54
#define PP_MANAGEMENT_LENGTH 48 #define PP_MANAGEMENT_LENGTH 48
#define PP_DEFAULT_NEXT_DELAY_MS 1000
/* UDP/IPv4 dependent */ /* UDP/IPv4 dependent */
#define PP_SUBDOMAIN_ADDRESS_LENGTH 4 #define PP_SUBDOMAIN_ADDRESS_LENGTH 4
#define PP_PORT_ADDRESS_LENGTH 2 #define PP_PORT_ADDRESS_LENGTH 2
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
int pp_disabled(struct pp_instance *ppi, unsigned char *pkt, int plen) int pp_disabled(struct pp_instance *ppi, unsigned char *pkt, int plen)
{ {
/* TODO */ /* nothing to do */
ppi->next_delay = PP_DEFAULT_NEXT_DELAY_MS;
return 0; return 0;
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
int pp_faulty(struct pp_instance *ppi, unsigned char *pkt, int plen) int pp_faulty(struct pp_instance *ppi, unsigned char *pkt, int plen)
{ {
pp_printf("event FAULT_CLEARED\n"); pp_printf("event FAULT_CLEARED\n");
ppi->next_state = 1000; ppi->next_state = PPS_INITIALIZING;
ppi->next_delay = PPS_INITIALIZING; ppi->next_delay = PP_DEFAULT_NEXT_DELAY;
return 0; return 0;
} }
...@@ -61,10 +61,12 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen) ...@@ -61,10 +61,12 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
msg_pack_header(ppi->buf_out,ppi); msg_pack_header(ppi->buf_out,ppi);
ppi->next_state = PPS_LISTENING; ppi->next_state = PPS_LISTENING;
ppi->next_delay = PP_DEFAULT_NEXT_DELAY;
return 0; return 0;
failure: failure:
pp_printf("Failed to initialize network\n"); pp_printf("Failed to initialize network\n");
ppi->next_state = PPS_FAULTY; ppi->next_state = PPS_FAULTY;
ppi->next_delay = PP_DEFAULT_NEXT_DELAY;
return 0; return 0;
} }
...@@ -40,5 +40,7 @@ state_updated: ...@@ -40,5 +40,7 @@ state_updated:
pp_timer_stop(ppi->timers[PP_TIMER_ANNOUNCE_RECEIPT]); pp_timer_stop(ppi->timers[PP_TIMER_ANNOUNCE_RECEIPT]);
} }
ppi->next_delay = PP_DEFAULT_NEXT_DELAY;
return 0; return 0;
} }
...@@ -53,5 +53,7 @@ state_updated: ...@@ -53,5 +53,7 @@ state_updated:
pp_timer_stop(ppi->timers[PP_TIMER_PDELAYREQ_INTERVAL]); pp_timer_stop(ppi->timers[PP_TIMER_PDELAYREQ_INTERVAL]);
} }
ppi->next_delay = PP_DEFAULT_NEXT_DELAY;
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment