evtimer: add peek functionality to look into future#19
evtimer: add peek functionality to look into future#19miri64 wants to merge 3 commits intokaspar030:evtimerfrom
Conversation
| evtimer->events = NULL; | ||
| } | ||
|
|
||
| #if ENABLE_DEBUG == 1 |
There was a problem hiding this comment.
Due to this you will get link errors, if called externally, but ENABLE_DEBUG here is 0.
|
Added context capabilities to the peek context so one does not need to implement callbacks for every event type if there are multiple. |
I'm not sure peeking into the timers list is a good idea. Your use-case is "send RA only if next RA is more than X time away (or not scheduled)", right? |
It's even a little bit more complicated I realized. It's more like: if between 0 and X time units no NS is scheduled send now, if between X and 2X time units no NS is scheduled send in t
More expensive then broadcasting unnecessary messages? |
More expensive than thinking a little bit on what you want to achieve. |
<=3 multicast (per interface) when an unknown neighbor is to be resolved, <=3 unicast for any known neighbor when NUD is performed. Also rate-limited are multicast RAs and multicast NAs (both per interface). For a scalable network that's a lot of 32-bit numbers (in typically scarcer RAM) to save some bytes in ROM considering that the time is already saved in this event queue. |
Will return true, if `peek_cb` returns true for any event currently scheduled
Add peek context
8ac633c to
757c52a
Compare
|
Rebased. |
So you're scheduling all of them at once? Why not schedule one event to trigger the first and when it get's sent, schedule the next? |
You mean the messages of same type or in general? |
|
Every neighbor gets solicitations, right? And every interface gets RS. So now with N neighbors, you could schedule N*M (M<=3) solicitation packets (which was your original plan the way I read your use-case). |
Sorry, I mean, schedule the next, and remember when that should trigger and how many you've already sent. |
|
I've merged the uncrustify, milliseconds, ENABLE_DEBUG, casting fixes. |
No sorry that was really confusingly stated by me: of course I will only schedule the next NS. Let me think about (and try out) your proposal first. |
Will return true, if
peek_cbreturns true for any event currentlyscheduled.
I also added some wrappers for
evtimer_msg_event_tto have it similar easy to understand likextimer_send_msg().