]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Add remote-count and remote-entry query via management
authorSelva Nair <selva.nair@gmail.com>
Tue, 7 Sep 2021 22:31:24 +0000 (18:31 -0400)
committerGert Doering <gert@greenie.muc.de>
Tue, 27 Dec 2022 08:29:56 +0000 (09:29 +0100)
commit125263804701f9e62a5a27587e4ea6afdb21f54d
treec917bc7be180dd8911456671e88222665b221f8c
parent8516b4b3665aa94d3114194f33fbb9c34119ab71
Add remote-count and remote-entry query via management

Selecting the remote host via the management interface
(management-query-remote) provides a restrictive user
experience as there is no easy way to tabulate all available
remote entries and show a list to the user to choose from.
Fix that.

Two new commands for querying the management interface are added:
(i) remote-entry-count : returns the number of remotes specified
    in the config file. Example result:
       10
       END

(ii) remote-entry-get i [j]: returns the remote entry at index i
     in the form index,host,port,protocol. Or, if j is present
     all entries from index i to j-1 are returned, one per line.

     Example result for i = 2:
        2,ovpn.example.com,1194,udp
        END
     Example result for i = 2, j = 4
        2,ovpn.example.com,1194,udp
        3,ovpn.example.com,443,tcp-client
        END

     remote-entry-get all: returns all remote entries.

v2: use independent callback functions for the two commands
v3: return results as 0 or more lines terminated by END, as done
    for all other similar commands. v1 was fashioned after
    pkcs11-id-count and pkcs11-id-get which uses a format not
    consistent with the rest of the management commands.

See also management-notes.txt

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20210907223126.8440-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22815.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Changes.rst
doc/management-notes.txt
src/openvpn/init.c
src/openvpn/manage.c
src/openvpn/manage.h