Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Add libevent support #83

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

pprindeville
Copy link
Collaborator

Let the connections to servers be event-driven by libevent.

@pprindeville
Copy link
Collaborator Author

This should go in after PR #78.

@pprindeville pprindeville force-pushed the add-libevent-support branch 2 times, most recently from 06b8624 to 5e94472 Compare December 13, 2016 03:31
Derive the authentication type from tac_login string
It's precursory to separate marshalling functions from I/O if
event-driven I/O is to be done, or if multiple Tacacs+ sessions
can be active at the same time (you don't want to be polling on
one socket and miss a timeout on another).
Unnecessary casts are a blight in that they mask possible programming
errors.  We shouldn't use them where they aren't required.

Also, add a convenience function to convert a header pointer to a
body pointer by adding the correct offset.
If you're connecting to multiple servers simultaneously, then
per-server parameters can't be globals.  Move them into a
session container.

Note: this obviously has API and ABI compatibility implications.
As this is obviously related to the session.
Let the connections to servers be event-driven by libevent.
Add method for setting whether session is multiplexed or not; mark
packet header flags appropriately; reset timeouts on connection when
we have received a response (since our request has been answered, no
more data will be read or written for now).
A session is 'busy' when a request has been sent, and the
response not yet received.  As soon as the response is received,
the session re-enters the 'idle' state (and any associated read
timeouts can be cleared).

We also clear timeouts when a session enters connected state,
but only if we hadn't pre-queued the first request.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant