Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCH 5/5] client: add session source ip rule
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Mon, 12 Dec 2016 18:35:08 +0000
From: [email protected]
To: [email protected]
Subject: [PATCH 5/5] client: add session source ip rule
Message-ID: <[email protected]>

From: Lukasz Nowak <[email protected]>

Add a session config field to enable/disable creation of the
source ip rule in iptables by a session.
---
 client/commands.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/client/commands.c b/client/commands.c
index c41e9b4..583095b 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -1897,6 +1897,7 @@ static int session_config(char *args[], int num,
        struct config_append append;
        char c;
        char *ifname;
+       dbus_bool_t source_ip_rule;
 
        while (index < num && args[index]) {
                append.opts = &args[index];
@@ -1935,6 +1936,29 @@ static int session_config(char *args[], int num,
                                        DBUS_TYPE_STRING, &ifname);
                        append.values = 2;
                        break;
+               case 's':
+                       if (!args[index + 1]) {
+                               res = -EINVAL;
+                               break;
+                       }
+                       switch (parse_boolean(args[index + 1])) {
+                       case 1:
+                               source_ip_rule = TRUE;
+                               break;
+                       case 0:
+                               source_ip_rule = FALSE;
+                               break;
+                       default:
+                               res = -EINVAL;
+                               break;
+                       }
+
+                       res = __connmanctl_dbus_session_change(connection,
+                                       session_path, session_config_return,
+                                       "SourceIPRule", "SourceIPRule",
+                                       DBUS_TYPE_BOOLEAN, &source_ip_rule);
+                       append.values = 2;
+                       break;
 
                default:
                        res = -EINVAL;
@@ -2223,6 +2247,7 @@ static struct connman_option session_options[] = {
        {"bearers", 'b', "<technology1> [<technology2> [...]]"},
        {"type", 't', "local|internet|any"},
        {"ifname", 'i', "[<interface_name>]"},
+       {"srciprule", 's', "yes|no"},
        { NULL, }
 };
 
-- 
2.7.4



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 14, Issue 17
***************************************

Reply via email to