From: Patrik Flykt <[email protected]>

        Hi,

Here's an attempt of requesting OpenConnect cookies through the Agent API.

Two new fields are introduced to be used by the 'RequestInput' Agent API
D-Bus method call, 'OpenConnect.Cookie' and 'Hostname',  as well as a 'Value'
argument (patch 01). The 'Hostname' field will contain the name of the
openconnect host in its 'Value' argument. The 'Hostname' field does not set
a 'Requirement' attribute, thus making the 'Hostname' field informative only
for the Agent.

Agent API support is added in a straightforward fashion with the above fields
added to the 'RequestInput' method call (patch 02). As the function is to
be used from the openconnect vpn plugin, a new 'agent.h' header file with the
function prototype has been created.

Since the openconnect plugin uses provider structs, a helper function for
digging up the corresponding service struct needed in the Agent API was
created (patch 03).

When openconnect is run and the plugin discovers it doesn't have a cookie set,
it makes a request for it through the Agent API. When the supplied callback is
called, the cookie is stored for the provider and an attempt of connecting
the VPN is made (patch 04). Pending cookie requests are kept on a list and
structures on that list are carefully cleared if the openconnect VPN is
reporting something else meanwhile.

The test script is updated not to require a cookie (patch 05).


Cheers,

        Patrik



Patrik Flykt (5):
  doc: Add OpenConnect.Cookie and Hostname fields and Value Attribute
  agent: Implement function to request a cookie for openconnect
  provider: Add helper function for fetching provider service
  openconnect: Request cookie on connect
  test: Cookie is not a mandatory connect-vpn command line argument

 Makefile.am           |    2 +-
 doc/agent-api.txt     |   19 +++++++
 include/agent.h       |   40 +++++++++++++++
 include/provider.h    |    1 +
 plugins/openconnect.c |   99 +++++++++++++++++++++++++++++++++++-
 src/agent.c           |  134 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/connman.h         |    2 +
 src/provider.c        |    5 ++
 test/connect-vpn      |   12 +++-
 9 files changed, 308 insertions(+), 6 deletions(-)
 create mode 100644 include/agent.h

-- 
1.7.2.5

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to