[v3,04/15] protobuf: add SysctlEntry for ipv4/ipv6 sysctl confs or some others

Submitted by Pavel Tikhomirov on April 21, 2016, 8:16 a.m.

Details

Message ID 1461226589-21513-1-git-send-email-ptikhomirov@virtuozzo.com
State Rejected
Series "net/ipv6: c/r dev/default/all conf ops"
Headers show

Patch hide | download patch | download mbox

diff --git a/images/Makefile b/images/Makefile
index 52f516e..b5a2804 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -59,6 +59,7 @@  proto-obj-y	+= seccomp.o
 proto-obj-y	+= binfmt-misc.o
 proto-obj-y	+= time.o
 proto-obj-y	+= autofs.o
+proto-obj-y	+= sysctl.o
 
 CFLAGS		+= -iquote $(obj)/
 
diff --git a/images/netdev.proto b/images/netdev.proto
index dafa2bd..ce0daeb 100644
--- a/images/netdev.proto
+++ b/images/netdev.proto
@@ -1,5 +1,6 @@ 
 import "opts.proto";
 import "tun.proto";
+import "sysctl.proto";
 
 enum nd_type {
 	LOOPBACK	= 1;
@@ -31,9 +32,14 @@  message net_device_entry {
 	optional bytes address		= 7;
 
 	repeated int32 conf		= 8;
+
+	repeated sysctl_entry conf4	= 9;
 }
 
 message netns_entry {
 	repeated int32 def_conf		= 1;
 	repeated int32 all_conf		= 2;
+
+	repeated sysctl_entry def_conf4	= 3;
+	repeated sysctl_entry all_conf4	= 4;
 }
diff --git a/images/sysctl.proto b/images/sysctl.proto
new file mode 100644
index 0000000..4f0d94b
--- /dev/null
+++ b/images/sysctl.proto
@@ -0,0 +1,7 @@ 
+message sysctl_entry {
+	/* CTL_32, __CTL_STR */
+	required int32 type		= 1;
+
+	optional int32 iarg		= 2;
+	optional string sarg		= 3;
+}

Comments

Pavel Emelianov April 21, 2016, 2:12 p.m.
> @@ -0,0 +1,7 @@
> +message sysctl_entry {
> +	/* CTL_32, __CTL_STR */
> +	required int32 type		= 1;

It seems to be bad practice to keep enums as ints. Better introduce the
protobuf enum for this.

> +
> +	optional int32 iarg		= 2;
> +	optional string sarg		= 3;
> +}
>