mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 05:48:05 +00:00
protobuf: add SysctlEntry for ipv4/ipv6 sysctl confs or some others
int32 with boolean value in protobuf has the same size with bool, many sysctls are boolean but we don't lose anything by storing them in int32, so add only int32 and string fields will need string field for stable_secret ipv6 sysctl also such fromat allows us to easily handle non-present int sysctls we can check if we have it using has_*arg v3: rebase images/Makefile to criu-dev branch v4: use enum for type Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Reviewed-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
3f6ad33f8f
commit
7ea8601c99
@ -58,6 +58,7 @@ proto-obj-y += opts.o
|
|||||||
proto-obj-y += seccomp.o
|
proto-obj-y += seccomp.o
|
||||||
proto-obj-y += binfmt-misc.o
|
proto-obj-y += binfmt-misc.o
|
||||||
proto-obj-y += time.o
|
proto-obj-y += time.o
|
||||||
|
proto-obj-y += sysctl.o
|
||||||
|
|
||||||
CFLAGS += -iquote $(obj)/
|
CFLAGS += -iquote $(obj)/
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import "opts.proto";
|
import "opts.proto";
|
||||||
import "tun.proto";
|
import "tun.proto";
|
||||||
|
import "sysctl.proto";
|
||||||
|
|
||||||
enum nd_type {
|
enum nd_type {
|
||||||
LOOPBACK = 1;
|
LOOPBACK = 1;
|
||||||
@ -31,9 +32,14 @@ message net_device_entry {
|
|||||||
optional bytes address = 7;
|
optional bytes address = 7;
|
||||||
|
|
||||||
repeated int32 conf = 8;
|
repeated int32 conf = 8;
|
||||||
|
|
||||||
|
repeated sysctl_entry conf4 = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
message netns_entry {
|
message netns_entry {
|
||||||
repeated int32 def_conf = 1;
|
repeated int32 def_conf = 1;
|
||||||
repeated int32 all_conf = 2;
|
repeated int32 all_conf = 2;
|
||||||
|
|
||||||
|
repeated sysctl_entry def_conf4 = 3;
|
||||||
|
repeated sysctl_entry all_conf4 = 4;
|
||||||
}
|
}
|
||||||
|
11
images/sysctl.proto
Normal file
11
images/sysctl.proto
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
enum SysctlType {
|
||||||
|
__CTL_STR = 5;
|
||||||
|
CTL_32 = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
message sysctl_entry {
|
||||||
|
required SysctlType type = 1;
|
||||||
|
|
||||||
|
optional int32 iarg = 2;
|
||||||
|
optional string sarg = 3;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user