mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-08 19:44:17 +00:00
Rename TIME_NEVER... to TIME_MS_NEVER...
This commit is contained in:
parent
ca9faeef9b
commit
936db7bca3
@ -133,7 +133,7 @@ int _schedule(struct __sourceloc __whence, struct sched_ent *alarm)
|
||||
return WHY("Can't schedule if you haven't set the function pointer");
|
||||
|
||||
// don't bother to schedule an alarm that will (by definition) never run
|
||||
if (alarm->alarm == TIME_NEVER_WILL)
|
||||
if (alarm->alarm == TIME_MS_NEVER_WILL)
|
||||
return 0;
|
||||
|
||||
if (alarm->deadline < alarm->alarm)
|
||||
|
10
msp_client.c
10
msp_client.c
@ -78,9 +78,9 @@ struct msp_sock * msp_socket(int mdp_sock)
|
||||
ret->_next = root;
|
||||
// TODO set base rtt to ensure that we send the first packet a few times before giving up
|
||||
ret->tx.base_rtt = ret->tx.rtt = 0xFFFFFFFF;
|
||||
ret->tx.last_activity = TIME_NEVER_HAS;
|
||||
ret->rx.last_activity = TIME_NEVER_HAS;
|
||||
ret->next_action = TIME_NEVER_WILL;
|
||||
ret->tx.last_activity = TIME_MS_NEVER_HAS;
|
||||
ret->rx.last_activity = TIME_MS_NEVER_HAS;
|
||||
ret->next_action = TIME_MS_NEVER_WILL;
|
||||
ret->timeout = gettime_ms() + 10000;
|
||||
ret->previous_ack = 0x7FFF;
|
||||
if (root)
|
||||
@ -552,7 +552,7 @@ static int process_sock(struct msp_sock *sock)
|
||||
|
||||
int msp_processing(time_ms_t *next_action)
|
||||
{
|
||||
*next_action=TIME_NEVER_WILL;
|
||||
*next_action=TIME_MS_NEVER_WILL;
|
||||
struct msp_sock *sock = root;
|
||||
time_ms_t now = gettime_ms();
|
||||
while(sock){
|
||||
@ -602,7 +602,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t
|
||||
DEBUGF("Bound to %s:%d", alloca_tohex_sid_t(header->local.sid), header->local.port);
|
||||
s->next_action = gettime_ms();
|
||||
if (s->state & MSP_STATE_LISTENING)
|
||||
s->timeout = TIME_NEVER_WILL;
|
||||
s->timeout = TIME_MS_NEVER_WILL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
4
os.h
4
os.h
@ -56,8 +56,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
typedef int64_t time_ms_t;
|
||||
#define PRItime_ms_t PRId64
|
||||
#define TIME_NEVER_WILL INT64_MAX
|
||||
#define TIME_NEVER_HAS INT64_MIN
|
||||
#define TIME_MS_NEVER_WILL INT64_MAX
|
||||
#define TIME_MS_NEVER_HAS INT64_MIN
|
||||
|
||||
time_ms_t gettime_ms();
|
||||
time_ms_t sleep_ms(time_ms_t milliseconds);
|
||||
|
@ -171,7 +171,7 @@ static struct profile_total link_send_stats={
|
||||
static struct sched_ent link_send_alarm={
|
||||
.function = link_send,
|
||||
.stats = &link_send_stats,
|
||||
.alarm = TIME_NEVER_WILL,
|
||||
.alarm = TIME_MS_NEVER_WILL,
|
||||
};
|
||||
|
||||
struct neighbour *neighbours=NULL;
|
||||
@ -185,7 +185,7 @@ struct network_destination * new_destination(struct overlay_interface *interface
|
||||
ret->encapsulation = encapsulation;
|
||||
ret->interface = interface;
|
||||
ret->resend_delay = 1000;
|
||||
ret->last_tx = TIME_NEVER_HAS;
|
||||
ret->last_tx = TIME_MS_NEVER_HAS;
|
||||
ret->sequence_number = -1;
|
||||
ret->last_ack_seq = -1;
|
||||
}
|
||||
@ -882,7 +882,7 @@ static int link_send_neighbours()
|
||||
// send link details
|
||||
static void link_send(struct sched_ent *alarm)
|
||||
{
|
||||
alarm->alarm=TIME_NEVER_WILL;
|
||||
alarm->alarm=TIME_MS_NEVER_WILL;
|
||||
|
||||
// TODO use a separate alarm
|
||||
link_send_neighbours();
|
||||
|
Loading…
x
Reference in New Issue
Block a user