From e869178931b5a149d67b0e4cf5bedc183d32e905 Mon Sep 17 00:00:00 2001 From: Matthias Frei Date: Thu, 18 Jul 2019 14:49:44 +0200 Subject: [PATCH] Add generated go/proto files to git Add the generated *.capnp.go and structs.gen.go files in go/proto to version control. This intends to simplify the build process when using the go toolchain, especially for go projects that consume scion as a library. Add make target 'gogen' to update the generated files in go/proto. Use new bazel pkg_tar rule 'build-tools' to compile canpnpc-go for generating the *.capnpc.go files. Add CI check for generated go/proto files; detect uncommitted changes to generated go/proto files by cleaning and regenerating the files. --- .buildkite/steps/test.yml | 3 + BUILD.bazel | 11 + Makefile | 20 +- docker/perapp/base/Dockerfile.builder | 2 +- go/proto/BUILD.bazel | 51 +- go/proto/Makefile | 19 + go/proto/ack.capnp.go | 170 ++ go/proto/asm_exts.capnp.go | 200 +++ go/proto/cert_mgmt.capnp.go | 791 ++++++++ go/proto/common.capnp.go | 192 ++ go/proto/ctrl_extn.capnp.go | 188 ++ go/proto/ctrl_pld.capnp.go | 606 +++++++ go/proto/drkey_mgmt.capnp.go | 458 +++++ go/proto/if_state.capnp.go | 268 +++ go/proto/ifid.capnp.go | 82 + go/proto/path_mgmt.capnp.go | 2105 ++++++++++++++++++++++ go/proto/path_seg.capnp.go | 771 ++++++++ go/proto/rev_info.capnp.go | 123 ++ go/proto/sciond.capnp.go | 2400 +++++++++++++++++++++++++ go/proto/sibra.capnp.go | 195 ++ go/proto/sig.capnp.go | 379 ++++ go/proto/sign.capnp.go | 284 +++ go/proto/structs.gen.go | 105 ++ go/proto/structs_gen_go.sh | 4 +- go/proto/svc_resolution.capnp.go | 201 +++ go/proto/zkid.capnp.go | 216 +++ scion.sh | 11 +- tools/ci/checkgogen | 5 + 28 files changed, 9806 insertions(+), 54 deletions(-) create mode 100644 go/proto/Makefile create mode 100644 go/proto/ack.capnp.go create mode 100644 go/proto/asm_exts.capnp.go create mode 100644 go/proto/cert_mgmt.capnp.go create mode 100644 go/proto/common.capnp.go create mode 100644 go/proto/ctrl_extn.capnp.go create mode 100644 go/proto/ctrl_pld.capnp.go create mode 100644 go/proto/drkey_mgmt.capnp.go create mode 100644 go/proto/if_state.capnp.go create mode 100644 go/proto/ifid.capnp.go create mode 100644 go/proto/path_mgmt.capnp.go create mode 100644 go/proto/path_seg.capnp.go create mode 100644 go/proto/rev_info.capnp.go create mode 100644 go/proto/sciond.capnp.go create mode 100644 go/proto/sibra.capnp.go create mode 100644 go/proto/sig.capnp.go create mode 100644 go/proto/sign.capnp.go create mode 100644 go/proto/structs.gen.go create mode 100644 go/proto/svc_resolution.capnp.go create mode 100644 go/proto/zkid.capnp.go create mode 100755 tools/ci/checkgogen diff --git a/.buildkite/steps/test.yml b/.buildkite/steps/test.yml index 1445f5284a..327513e1a1 100644 --- a/.buildkite/steps/test.yml +++ b/.buildkite/steps/test.yml @@ -1,3 +1,6 @@ +- label: "Check generated go/proto files in git" + command: $BASE/run_step checkgogen + timeout_in_minutes: 10 - label: "Unit tests :bazel:" command: $BASE/run_step test artifact_paths: diff --git a/BUILD.bazel b/BUILD.bazel index 79d39e5b73..c4ba8c26d1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -66,6 +66,17 @@ pkg_tar( mode = "0755", ) +# This is a package of tools used for generating code that is checked in +# to git (i.e. outside of bazels reach). +pkg_tar( + name = "build-tools", + package_dir = "", + srcs = [ + "@com_zombiezen_go_capnproto2//capnpc-go:capnpc-go", + ], + mode = "0755", +) + # Nogo - Go code analysis tool nogo( name = "nogo", diff --git a/Makefile b/Makefile index 616f123b07..2b4f6c84ec 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all clean goenv gogenlinks gogenlinks_clean vendor mocks bazel bazel_bin_clean gazelle setcap clibs libscion libfilter dispatcher uninstall tags +.PHONY: all clean goenv gogen vendor mocks bazel bazel_bin_clean gazelle setcap clibs libscion libfilter dispatcher uninstall tags BRACCEPT = bin/braccept @@ -8,26 +8,26 @@ SRC_DIRS = c/lib/scion c/lib/filter c/dispatcher all: tags clibs dispatcher bazel -clean: gogenlinks_clean +clean: $(foreach var,$(SRC_DIRS),$(MAKE) -C $(var) clean || exit 1;) bazel clean rm -f bin/* tags if [ -e go/vendor ]; then rm -r go/vendor; fi -goenv: vendor gogenlinks +gogen: +ifndef GOGEN_SKIP + $(MAKE) -C go/proto +else + @echo "gogen: skipped" +endif -gogenlinks: gogenlinks_clean - bazel build //go/proto:go_default_library - find bazel-genfiles/go/proto -maxdepth 1 -type f -exec ln -snf ../../{} go/proto \; - -gogenlinks_clean: - find ./go/proto -maxdepth 1 -type l -exec rm {} + +goenv: vendor vendor: if [ -e go/vendor ]; then rm -r go/vendor; fi bzlcompat -vendorBase=go -bazel: vendor bazel_bin_clean +bazel: vendor gogen bazel_bin_clean bazel build //:scion //:scion-ci --workspace_status_command=./tools/bazel-build-env tar -kxf bazel-bin/scion.tar -C bin tar -kxf bazel-bin/scion-ci.tar -C bin diff --git a/docker/perapp/base/Dockerfile.builder b/docker/perapp/base/Dockerfile.builder index 1602301c8e..60a7f2ef05 100644 --- a/docker/perapp/base/Dockerfile.builder +++ b/docker/perapp/base/Dockerfile.builder @@ -1,3 +1,3 @@ FROM scion:latest COPY bazelrc.quiet ~/.bazelrc -RUN make -s all setcap && bazel clean +RUN make -s GOGEN_SKIP=1 all setcap && bazel clean diff --git a/go/proto/BUILD.bazel b/go/proto/BUILD.bazel index e20608cfc6..2c39eeee57 100644 --- a/go/proto/BUILD.bazel +++ b/go/proto/BUILD.bazel @@ -8,43 +8,7 @@ go_library( "cereal.go", "doc.go", "sign.go", - ":structs", - ":capnp", - ], - importpath = "github.com/scionproto/scion/go/proto", - visibility = ["//visibility:public"], - deps = [ - "//go/lib/common:go_default_library", - "//go/lib/scrypto:go_default_library", - "//go/lib/util:go_default_library", - "@com_zombiezen_go_capnproto2//:go_default_library", - "@com_zombiezen_go_capnproto2//encoding/text:go_default_library", - "@com_zombiezen_go_capnproto2//pogs:go_default_library", - "@com_zombiezen_go_capnproto2//schemas:go_default_library", - ], -) - -genrule( - name = "structs", - srcs = [], - outs = ["structs.gen.go"], - cmd = "./$(location structs_gen_go.sh) > \"$@\"", - tools = ["structs_gen_go.sh"], - visibility = ["//visibility:public"], -) - -# TODO(sustrik): At the moment we have a copied version of go.capnp in proto directory. -# Once python is Bazelified we can copy it as part of the build process. -# Specifically we would need to add "@com_zombiezen_go_capnproto2//std:go.capnp" to -# srcs and -I$$(dirname \"$(location @com_zombiezen_go_capnproto2//std:go.capnp)\") -# to the command line. Also "go.capnp" inside individual capnp files should be changed -# to "/go.capnp". -genrule( - name = "capnp", - srcs = [ - "//proto:sources", - ], - outs = [ + "structs.gen.go", "ack.capnp.go", "asm_exts.capnp.go", "cert_mgmt.capnp.go", @@ -64,6 +28,15 @@ genrule( "svc_resolution.capnp.go", "zkid.capnp.go", ], - cmd = "capnp compile -o$(location @com_zombiezen_go_capnproto2//capnpc-go:capnpc-go):$(@D) --src-prefix=proto $(locations //proto:sources)", - tools = ["@com_zombiezen_go_capnproto2//capnpc-go:capnpc-go"], + importpath = "github.com/scionproto/scion/go/proto", + visibility = ["//visibility:public"], + deps = [ + "//go/lib/common:go_default_library", + "//go/lib/scrypto:go_default_library", + "//go/lib/util:go_default_library", + "@com_zombiezen_go_capnproto2//:go_default_library", + "@com_zombiezen_go_capnproto2//encoding/text:go_default_library", + "@com_zombiezen_go_capnproto2//pogs:go_default_library", + "@com_zombiezen_go_capnproto2//schemas:go_default_library", + ], ) diff --git a/go/proto/Makefile b/go/proto/Makefile new file mode 100644 index 0000000000..039e5f15de --- /dev/null +++ b/go/proto/Makefile @@ -0,0 +1,19 @@ +.PHONY: all capnp + +PROTO_DIR := ../../proto +SRCS := $(wildcard $(PROTO_DIR)/*.capnp) +SRCS := $(filter-out $(PROTO_DIR)/go.capnp, $(SRCS)) + +all: capnp structs.gen.go + +capnp: + set -eu; \ + TMPDIR=$$(mktemp -d -t scion-build-tools.XXXXXXXXXX); \ + bazel build //:build-tools; \ + tar -xf ../../bazel-bin/build-tools.tar -C $$TMPDIR; \ + rm -f *.capnp.go; \ + capnp compile --verbose -o$$TMPDIR/capnpc-go --src-prefix $(PROTO_DIR) $(SRCS); \ + rm -rf $$TMPDIR + +structs.gen.go: structs_gen_go.sh + ./structs_gen_go.sh > structs.gen.go diff --git a/go/proto/ack.capnp.go b/go/proto/ack.capnp.go new file mode 100644 index 0000000000..a5ae38a2f5 --- /dev/null +++ b/go/proto/ack.capnp.go @@ -0,0 +1,170 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type Ack struct{ capnp.Struct } + +// Ack_TypeID is the unique identifier for the type Ack. +const Ack_TypeID = 0xf0ad983ad234aedc + +func NewAck(s *capnp.Segment) (Ack, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Ack{st}, err +} + +func NewRootAck(s *capnp.Segment) (Ack, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Ack{st}, err +} + +func ReadRootAck(msg *capnp.Message) (Ack, error) { + root, err := msg.RootPtr() + return Ack{root.Struct()}, err +} + +func (s Ack) String() string { + str, _ := text.Marshal(0xf0ad983ad234aedc, s.Struct) + return str +} + +func (s Ack) Err() Ack_ErrCode { + return Ack_ErrCode(s.Struct.Uint16(0)) +} + +func (s Ack) SetErr(v Ack_ErrCode) { + s.Struct.SetUint16(0, uint16(v)) +} + +func (s Ack) ErrDesc() (string, error) { + p, err := s.Struct.Ptr(0) + return p.Text(), err +} + +func (s Ack) HasErrDesc() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s Ack) ErrDescBytes() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return p.TextBytes(), err +} + +func (s Ack) SetErrDesc(v string) error { + return s.Struct.SetText(0, v) +} + +// Ack_List is a list of Ack. +type Ack_List struct{ capnp.List } + +// NewAck creates a new list of Ack. +func NewAck_List(s *capnp.Segment, sz int32) (Ack_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return Ack_List{l}, err +} + +func (s Ack_List) At(i int) Ack { return Ack{s.List.Struct(i)} } + +func (s Ack_List) Set(i int, v Ack) error { return s.List.SetStruct(i, v.Struct) } + +func (s Ack_List) String() string { + str, _ := text.MarshalList(0xf0ad983ad234aedc, s.List) + return str +} + +// Ack_Promise is a wrapper for a Ack promised by a client call. +type Ack_Promise struct{ *capnp.Pipeline } + +func (p Ack_Promise) Struct() (Ack, error) { + s, err := p.Pipeline.Struct() + return Ack{s}, err +} + +type Ack_ErrCode uint16 + +// Ack_ErrCode_TypeID is the unique identifier for the type Ack_ErrCode. +const Ack_ErrCode_TypeID = 0xdf6d763cff9bd528 + +// Values of Ack_ErrCode. +const ( + Ack_ErrCode_ok Ack_ErrCode = 0 + Ack_ErrCode_retry Ack_ErrCode = 1 + Ack_ErrCode_reject Ack_ErrCode = 2 +) + +// String returns the enum's constant name. +func (c Ack_ErrCode) String() string { + switch c { + case Ack_ErrCode_ok: + return "ok" + case Ack_ErrCode_retry: + return "retry" + case Ack_ErrCode_reject: + return "reject" + + default: + return "" + } +} + +// Ack_ErrCodeFromString returns the enum value with a name, +// or the zero value if there's no such value. +func Ack_ErrCodeFromString(c string) Ack_ErrCode { + switch c { + case "ok": + return Ack_ErrCode_ok + case "retry": + return Ack_ErrCode_retry + case "reject": + return Ack_ErrCode_reject + + default: + return 0 + } +} + +type Ack_ErrCode_List struct{ capnp.List } + +func NewAck_ErrCode_List(s *capnp.Segment, sz int32) (Ack_ErrCode_List, error) { + l, err := capnp.NewUInt16List(s, sz) + return Ack_ErrCode_List{l.List}, err +} + +func (l Ack_ErrCode_List) At(i int) Ack_ErrCode { + ul := capnp.UInt16List{List: l.List} + return Ack_ErrCode(ul.At(i)) +} + +func (l Ack_ErrCode_List) Set(i int, v Ack_ErrCode) { + ul := capnp.UInt16List{List: l.List} + ul.Set(i, uint16(v)) +} + +const schema_c736b44d517db44a = "x\xdaL\xce1J\x03a\x14\x04\xe0\x99\x7fwM\x90" + + "\xd5\xf8@\x11\x04Y\x10\x8bX\x18D\x82\xc5\"h\xa2" + + "[(\x88y\xa5\x85EX\xff\xc6E\x13\x9eA\xb1\x90" + + "\\C\xf0\x0cZH\xc0#\xd8\x0bv\x82W\xf0\x06+" + + "Ialg\x86\x8fY\xe8\xec;\x89\xde\x00\xadF3" + + "e\xfd\xf3\xa9\xdc\xbd\xbd\xfa\x86\xcc\xbb\xf2\xeb\xa5\xf9\x91" + + ">>\xff\x00\x94\xd6\xab\x1cU\x00\xc9N\xc1i\xa1\xb3" + + "dy\x1f\xfc\x19H&\x88\x86\xe4\xbf\x9fl\x0f3\x9b\xa0" + + "Z\x0dB $ \x1bk\x80\xae\x07\xd4-Gr\x91" + + "\xe3l\xb3\x0dh=\xa06\x1d+\xde\x8c\xb5\xa9\x02\xb2" + + "\x06\x0e\xbd\xd9\xa1\xbf\xc9\x19\xc31\x06\x7f\x03\x00\x00\xff" + + "\xff)\xe3JV" + +func init() { + schemas.Register(schema_c736b44d517db44a, + 0xdf6d763cff9bd528, + 0xf0ad983ad234aedc) +} diff --git a/go/proto/asm_exts.capnp.go b/go/proto/asm_exts.capnp.go new file mode 100644 index 0000000000..6b16a6791b --- /dev/null +++ b/go/proto/asm_exts.capnp.go @@ -0,0 +1,200 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type RoutingPolicyExt struct{ capnp.Struct } + +// RoutingPolicyExt_TypeID is the unique identifier for the type RoutingPolicyExt. +const RoutingPolicyExt_TypeID = 0x96c1dab83835e4f9 + +func NewRoutingPolicyExt(s *capnp.Segment) (RoutingPolicyExt, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return RoutingPolicyExt{st}, err +} + +func NewRootRoutingPolicyExt(s *capnp.Segment) (RoutingPolicyExt, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return RoutingPolicyExt{st}, err +} + +func ReadRootRoutingPolicyExt(msg *capnp.Message) (RoutingPolicyExt, error) { + root, err := msg.RootPtr() + return RoutingPolicyExt{root.Struct()}, err +} + +func (s RoutingPolicyExt) String() string { + str, _ := text.Marshal(0x96c1dab83835e4f9, s.Struct) + return str +} + +func (s RoutingPolicyExt) Set() bool { + return s.Struct.Bit(0) +} + +func (s RoutingPolicyExt) SetSet(v bool) { + s.Struct.SetBit(0, v) +} + +func (s RoutingPolicyExt) PolType() uint8 { + return s.Struct.Uint8(1) +} + +func (s RoutingPolicyExt) SetPolType(v uint8) { + s.Struct.SetUint8(1, v) +} + +func (s RoutingPolicyExt) IfID() uint64 { + return s.Struct.Uint64(8) +} + +func (s RoutingPolicyExt) SetIfID(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s RoutingPolicyExt) Isdases() (capnp.UInt64List, error) { + p, err := s.Struct.Ptr(0) + return capnp.UInt64List{List: p.List()}, err +} + +func (s RoutingPolicyExt) HasIsdases() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s RoutingPolicyExt) SetIsdases(v capnp.UInt64List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewIsdases sets the isdases field to a newly +// allocated capnp.UInt64List, preferring placement in s's segment. +func (s RoutingPolicyExt) NewIsdases(n int32) (capnp.UInt64List, error) { + l, err := capnp.NewUInt64List(s.Struct.Segment(), n) + if err != nil { + return capnp.UInt64List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// RoutingPolicyExt_List is a list of RoutingPolicyExt. +type RoutingPolicyExt_List struct{ capnp.List } + +// NewRoutingPolicyExt creates a new list of RoutingPolicyExt. +func NewRoutingPolicyExt_List(s *capnp.Segment, sz int32) (RoutingPolicyExt_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}, sz) + return RoutingPolicyExt_List{l}, err +} + +func (s RoutingPolicyExt_List) At(i int) RoutingPolicyExt { return RoutingPolicyExt{s.List.Struct(i)} } + +func (s RoutingPolicyExt_List) Set(i int, v RoutingPolicyExt) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s RoutingPolicyExt_List) String() string { + str, _ := text.MarshalList(0x96c1dab83835e4f9, s.List) + return str +} + +// RoutingPolicyExt_Promise is a wrapper for a RoutingPolicyExt promised by a client call. +type RoutingPolicyExt_Promise struct{ *capnp.Pipeline } + +func (p RoutingPolicyExt_Promise) Struct() (RoutingPolicyExt, error) { + s, err := p.Pipeline.Struct() + return RoutingPolicyExt{s}, err +} + +type ISDAnnouncementExt struct{ capnp.Struct } + +// ISDAnnouncementExt_TypeID is the unique identifier for the type ISDAnnouncementExt. +const ISDAnnouncementExt_TypeID = 0xc586650e812cc6a1 + +func NewISDAnnouncementExt(s *capnp.Segment) (ISDAnnouncementExt, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return ISDAnnouncementExt{st}, err +} + +func NewRootISDAnnouncementExt(s *capnp.Segment) (ISDAnnouncementExt, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return ISDAnnouncementExt{st}, err +} + +func ReadRootISDAnnouncementExt(msg *capnp.Message) (ISDAnnouncementExt, error) { + root, err := msg.RootPtr() + return ISDAnnouncementExt{root.Struct()}, err +} + +func (s ISDAnnouncementExt) String() string { + str, _ := text.Marshal(0xc586650e812cc6a1, s.Struct) + return str +} + +func (s ISDAnnouncementExt) Set() bool { + return s.Struct.Bit(0) +} + +func (s ISDAnnouncementExt) SetSet(v bool) { + s.Struct.SetBit(0, v) +} + +// ISDAnnouncementExt_List is a list of ISDAnnouncementExt. +type ISDAnnouncementExt_List struct{ capnp.List } + +// NewISDAnnouncementExt creates a new list of ISDAnnouncementExt. +func NewISDAnnouncementExt_List(s *capnp.Segment, sz int32) (ISDAnnouncementExt_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return ISDAnnouncementExt_List{l}, err +} + +func (s ISDAnnouncementExt_List) At(i int) ISDAnnouncementExt { + return ISDAnnouncementExt{s.List.Struct(i)} +} + +func (s ISDAnnouncementExt_List) Set(i int, v ISDAnnouncementExt) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s ISDAnnouncementExt_List) String() string { + str, _ := text.MarshalList(0xc586650e812cc6a1, s.List) + return str +} + +// ISDAnnouncementExt_Promise is a wrapper for a ISDAnnouncementExt promised by a client call. +type ISDAnnouncementExt_Promise struct{ *capnp.Pipeline } + +func (p ISDAnnouncementExt_Promise) Struct() (ISDAnnouncementExt, error) { + s, err := p.Pipeline.Struct() + return ISDAnnouncementExt{s}, err +} + +const schema_e6c88f91b6a1209e = "x\xdal\xce\xb1J\xf3P\x18\xc6\xf1\xe79'm\xda" + + "\xe1k{\xbe\xe6\x02\xc4QT\x10\x11T\x10\xad\xb4C" + + "\x07\xa1G\x1d\x05\x0d\xed\xd1\x06\xda$\x90T\xd2\xa9\x08" + + "\xe2*.\x8eBoB]\x1d\x14\xaf\xc1Y\xf4\x1a\x9c" + + "\"\xc7A\x11\\\x1f\xfe/\xef\xafv\xba%T\xe1\x0e" + + "\xd0\xa5B1\xffx]Y\xbd\x7fy\xb8\x86\xaeR\xe4" + + "73\xd3\xdb\xab\xcb\xe77\x14\xe8\x02K\x0dA\xb5\xe3" + + "\x02\xaa\xfd\x0e\xe6\xd3\xa7\xf9\xb3\x8a\xb9x\xb4)\x7fR" + + "\xc7\x05\x96\x17\xf8\x9f\xf5\x0d{T_\xe3&\x98\xfb\xc9" + + "\xf0\xd0di\"\x17\xbb~\x1c\xc6\xeb\xbb\xd1(\x0d\xc2" + + "\x93N4\x08\xba\xe3V\x96\xa2C\xea\x9at\x00\x87\x80" + + "\xf2g\x01} \xa9\xfb\x82\x8a\xf4hG\xb3\x0d\xe8#" + + "I=\x10T\x82\x1e\x05\xa0\x829@\xf7$u,H" + + "\xe9Q\x02jh\xc3\xbe\xa4>\x17t\x13\x93\x92\x10$" + + "8\x89\xa3\xc1\xfe86,B\xb0\x08V\x83\xe3v\x93" + + "e\x08\x96\xc1I\x90\xf4\xfc\xc4$\xac\x80\x1d\xc9\xaf\xb9" + + "\xf2\x87\xbc\xbd\xd7l\x84a4\x0a\xbbfh\xc2\xb4\x95" + + "1\xb5v\xe7\xdb\xfe\xcf\xdaK\x92\xda\xfb\xfd\xfd3\x00" + + "\x00\xff\xffm\xabO\x82" + +func init() { + schemas.Register(schema_e6c88f91b6a1209e, + 0x96c1dab83835e4f9, + 0xc586650e812cc6a1) +} diff --git a/go/proto/cert_mgmt.capnp.go b/go/proto/cert_mgmt.capnp.go new file mode 100644 index 0000000000..0097da823f --- /dev/null +++ b/go/proto/cert_mgmt.capnp.go @@ -0,0 +1,791 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + strconv "strconv" + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type CertChainReq struct{ capnp.Struct } + +// CertChainReq_TypeID is the unique identifier for the type CertChainReq. +const CertChainReq_TypeID = 0xc464d1e0777e54d3 + +func NewCertChainReq(s *capnp.Segment) (CertChainReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 0}) + return CertChainReq{st}, err +} + +func NewRootCertChainReq(s *capnp.Segment) (CertChainReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 0}) + return CertChainReq{st}, err +} + +func ReadRootCertChainReq(msg *capnp.Message) (CertChainReq, error) { + root, err := msg.RootPtr() + return CertChainReq{root.Struct()}, err +} + +func (s CertChainReq) String() string { + str, _ := text.Marshal(0xc464d1e0777e54d3, s.Struct) + return str +} + +func (s CertChainReq) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s CertChainReq) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s CertChainReq) Version() uint64 { + return s.Struct.Uint64(8) +} + +func (s CertChainReq) SetVersion(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s CertChainReq) CacheOnly() bool { + return s.Struct.Bit(128) +} + +func (s CertChainReq) SetCacheOnly(v bool) { + s.Struct.SetBit(128, v) +} + +// CertChainReq_List is a list of CertChainReq. +type CertChainReq_List struct{ capnp.List } + +// NewCertChainReq creates a new list of CertChainReq. +func NewCertChainReq_List(s *capnp.Segment, sz int32) (CertChainReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 24, PointerCount: 0}, sz) + return CertChainReq_List{l}, err +} + +func (s CertChainReq_List) At(i int) CertChainReq { return CertChainReq{s.List.Struct(i)} } + +func (s CertChainReq_List) Set(i int, v CertChainReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s CertChainReq_List) String() string { + str, _ := text.MarshalList(0xc464d1e0777e54d3, s.List) + return str +} + +// CertChainReq_Promise is a wrapper for a CertChainReq promised by a client call. +type CertChainReq_Promise struct{ *capnp.Pipeline } + +func (p CertChainReq_Promise) Struct() (CertChainReq, error) { + s, err := p.Pipeline.Struct() + return CertChainReq{s}, err +} + +type CertChain struct{ capnp.Struct } + +// CertChain_TypeID is the unique identifier for the type CertChain. +const CertChain_TypeID = 0xadadc71f7e190917 + +func NewCertChain(s *capnp.Segment) (CertChain, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CertChain{st}, err +} + +func NewRootCertChain(s *capnp.Segment) (CertChain, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CertChain{st}, err +} + +func ReadRootCertChain(msg *capnp.Message) (CertChain, error) { + root, err := msg.RootPtr() + return CertChain{root.Struct()}, err +} + +func (s CertChain) String() string { + str, _ := text.Marshal(0xadadc71f7e190917, s.Struct) + return str +} + +func (s CertChain) Chain() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s CertChain) HasChain() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertChain) SetChain(v []byte) error { + return s.Struct.SetData(0, v) +} + +// CertChain_List is a list of CertChain. +type CertChain_List struct{ capnp.List } + +// NewCertChain creates a new list of CertChain. +func NewCertChain_List(s *capnp.Segment, sz int32) (CertChain_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return CertChain_List{l}, err +} + +func (s CertChain_List) At(i int) CertChain { return CertChain{s.List.Struct(i)} } + +func (s CertChain_List) Set(i int, v CertChain) error { return s.List.SetStruct(i, v.Struct) } + +func (s CertChain_List) String() string { + str, _ := text.MarshalList(0xadadc71f7e190917, s.List) + return str +} + +// CertChain_Promise is a wrapper for a CertChain promised by a client call. +type CertChain_Promise struct{ *capnp.Pipeline } + +func (p CertChain_Promise) Struct() (CertChain, error) { + s, err := p.Pipeline.Struct() + return CertChain{s}, err +} + +type CertChainIssReq struct{ capnp.Struct } + +// CertChainIssReq_TypeID is the unique identifier for the type CertChainIssReq. +const CertChainIssReq_TypeID = 0xb2de94224c009676 + +func NewCertChainIssReq(s *capnp.Segment) (CertChainIssReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CertChainIssReq{st}, err +} + +func NewRootCertChainIssReq(s *capnp.Segment) (CertChainIssReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CertChainIssReq{st}, err +} + +func ReadRootCertChainIssReq(msg *capnp.Message) (CertChainIssReq, error) { + root, err := msg.RootPtr() + return CertChainIssReq{root.Struct()}, err +} + +func (s CertChainIssReq) String() string { + str, _ := text.Marshal(0xb2de94224c009676, s.Struct) + return str +} + +func (s CertChainIssReq) Cert() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s CertChainIssReq) HasCert() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertChainIssReq) SetCert(v []byte) error { + return s.Struct.SetData(0, v) +} + +// CertChainIssReq_List is a list of CertChainIssReq. +type CertChainIssReq_List struct{ capnp.List } + +// NewCertChainIssReq creates a new list of CertChainIssReq. +func NewCertChainIssReq_List(s *capnp.Segment, sz int32) (CertChainIssReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return CertChainIssReq_List{l}, err +} + +func (s CertChainIssReq_List) At(i int) CertChainIssReq { return CertChainIssReq{s.List.Struct(i)} } + +func (s CertChainIssReq_List) Set(i int, v CertChainIssReq) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s CertChainIssReq_List) String() string { + str, _ := text.MarshalList(0xb2de94224c009676, s.List) + return str +} + +// CertChainIssReq_Promise is a wrapper for a CertChainIssReq promised by a client call. +type CertChainIssReq_Promise struct{ *capnp.Pipeline } + +func (p CertChainIssReq_Promise) Struct() (CertChainIssReq, error) { + s, err := p.Pipeline.Struct() + return CertChainIssReq{s}, err +} + +type CertChainIssRep struct{ capnp.Struct } + +// CertChainIssRep_TypeID is the unique identifier for the type CertChainIssRep. +const CertChainIssRep_TypeID = 0xc95b16276878cfc1 + +func NewCertChainIssRep(s *capnp.Segment) (CertChainIssRep, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CertChainIssRep{st}, err +} + +func NewRootCertChainIssRep(s *capnp.Segment) (CertChainIssRep, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CertChainIssRep{st}, err +} + +func ReadRootCertChainIssRep(msg *capnp.Message) (CertChainIssRep, error) { + root, err := msg.RootPtr() + return CertChainIssRep{root.Struct()}, err +} + +func (s CertChainIssRep) String() string { + str, _ := text.Marshal(0xc95b16276878cfc1, s.Struct) + return str +} + +func (s CertChainIssRep) Chain() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s CertChainIssRep) HasChain() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertChainIssRep) SetChain(v []byte) error { + return s.Struct.SetData(0, v) +} + +// CertChainIssRep_List is a list of CertChainIssRep. +type CertChainIssRep_List struct{ capnp.List } + +// NewCertChainIssRep creates a new list of CertChainIssRep. +func NewCertChainIssRep_List(s *capnp.Segment, sz int32) (CertChainIssRep_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return CertChainIssRep_List{l}, err +} + +func (s CertChainIssRep_List) At(i int) CertChainIssRep { return CertChainIssRep{s.List.Struct(i)} } + +func (s CertChainIssRep_List) Set(i int, v CertChainIssRep) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s CertChainIssRep_List) String() string { + str, _ := text.MarshalList(0xc95b16276878cfc1, s.List) + return str +} + +// CertChainIssRep_Promise is a wrapper for a CertChainIssRep promised by a client call. +type CertChainIssRep_Promise struct{ *capnp.Pipeline } + +func (p CertChainIssRep_Promise) Struct() (CertChainIssRep, error) { + s, err := p.Pipeline.Struct() + return CertChainIssRep{s}, err +} + +type TRCReq struct{ capnp.Struct } + +// TRCReq_TypeID is the unique identifier for the type TRCReq. +const TRCReq_TypeID = 0xd4c43f7ac10a9dbc + +func NewTRCReq(s *capnp.Segment) (TRCReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return TRCReq{st}, err +} + +func NewRootTRCReq(s *capnp.Segment) (TRCReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return TRCReq{st}, err +} + +func ReadRootTRCReq(msg *capnp.Message) (TRCReq, error) { + root, err := msg.RootPtr() + return TRCReq{root.Struct()}, err +} + +func (s TRCReq) String() string { + str, _ := text.Marshal(0xd4c43f7ac10a9dbc, s.Struct) + return str +} + +func (s TRCReq) Isd() uint16 { + return s.Struct.Uint16(0) +} + +func (s TRCReq) SetIsd(v uint16) { + s.Struct.SetUint16(0, v) +} + +func (s TRCReq) Version() uint64 { + return s.Struct.Uint64(8) +} + +func (s TRCReq) SetVersion(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s TRCReq) CacheOnly() bool { + return s.Struct.Bit(16) +} + +func (s TRCReq) SetCacheOnly(v bool) { + s.Struct.SetBit(16, v) +} + +// TRCReq_List is a list of TRCReq. +type TRCReq_List struct{ capnp.List } + +// NewTRCReq creates a new list of TRCReq. +func NewTRCReq_List(s *capnp.Segment, sz int32) (TRCReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}, sz) + return TRCReq_List{l}, err +} + +func (s TRCReq_List) At(i int) TRCReq { return TRCReq{s.List.Struct(i)} } + +func (s TRCReq_List) Set(i int, v TRCReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s TRCReq_List) String() string { + str, _ := text.MarshalList(0xd4c43f7ac10a9dbc, s.List) + return str +} + +// TRCReq_Promise is a wrapper for a TRCReq promised by a client call. +type TRCReq_Promise struct{ *capnp.Pipeline } + +func (p TRCReq_Promise) Struct() (TRCReq, error) { + s, err := p.Pipeline.Struct() + return TRCReq{s}, err +} + +type TRC struct{ capnp.Struct } + +// TRC_TypeID is the unique identifier for the type TRC. +const TRC_TypeID = 0x9aee2af152a5f7d7 + +func NewTRC(s *capnp.Segment) (TRC, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return TRC{st}, err +} + +func NewRootTRC(s *capnp.Segment) (TRC, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return TRC{st}, err +} + +func ReadRootTRC(msg *capnp.Message) (TRC, error) { + root, err := msg.RootPtr() + return TRC{root.Struct()}, err +} + +func (s TRC) String() string { + str, _ := text.Marshal(0x9aee2af152a5f7d7, s.Struct) + return str +} + +func (s TRC) Trc() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s TRC) HasTrc() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s TRC) SetTrc(v []byte) error { + return s.Struct.SetData(0, v) +} + +// TRC_List is a list of TRC. +type TRC_List struct{ capnp.List } + +// NewTRC creates a new list of TRC. +func NewTRC_List(s *capnp.Segment, sz int32) (TRC_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return TRC_List{l}, err +} + +func (s TRC_List) At(i int) TRC { return TRC{s.List.Struct(i)} } + +func (s TRC_List) Set(i int, v TRC) error { return s.List.SetStruct(i, v.Struct) } + +func (s TRC_List) String() string { + str, _ := text.MarshalList(0x9aee2af152a5f7d7, s.List) + return str +} + +// TRC_Promise is a wrapper for a TRC promised by a client call. +type TRC_Promise struct{ *capnp.Pipeline } + +func (p TRC_Promise) Struct() (TRC, error) { + s, err := p.Pipeline.Struct() + return TRC{s}, err +} + +type CertMgmt struct{ capnp.Struct } +type CertMgmt_Which uint16 + +const ( + CertMgmt_Which_unset CertMgmt_Which = 0 + CertMgmt_Which_certChainReq CertMgmt_Which = 1 + CertMgmt_Which_certChain CertMgmt_Which = 2 + CertMgmt_Which_trcReq CertMgmt_Which = 3 + CertMgmt_Which_trc CertMgmt_Which = 4 + CertMgmt_Which_certChainIssReq CertMgmt_Which = 5 + CertMgmt_Which_certChainIssRep CertMgmt_Which = 6 +) + +func (w CertMgmt_Which) String() string { + const s = "unsetcertChainReqcertChaintrcReqtrccertChainIssReqcertChainIssRep" + switch w { + case CertMgmt_Which_unset: + return s[0:5] + case CertMgmt_Which_certChainReq: + return s[5:17] + case CertMgmt_Which_certChain: + return s[17:26] + case CertMgmt_Which_trcReq: + return s[26:32] + case CertMgmt_Which_trc: + return s[32:35] + case CertMgmt_Which_certChainIssReq: + return s[35:50] + case CertMgmt_Which_certChainIssRep: + return s[50:65] + + } + return "CertMgmt_Which(" + strconv.FormatUint(uint64(w), 10) + ")" +} + +// CertMgmt_TypeID is the unique identifier for the type CertMgmt. +const CertMgmt_TypeID = 0xa19070b486ecd839 + +func NewCertMgmt(s *capnp.Segment) (CertMgmt, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return CertMgmt{st}, err +} + +func NewRootCertMgmt(s *capnp.Segment) (CertMgmt, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return CertMgmt{st}, err +} + +func ReadRootCertMgmt(msg *capnp.Message) (CertMgmt, error) { + root, err := msg.RootPtr() + return CertMgmt{root.Struct()}, err +} + +func (s CertMgmt) String() string { + str, _ := text.Marshal(0xa19070b486ecd839, s.Struct) + return str +} + +func (s CertMgmt) Which() CertMgmt_Which { + return CertMgmt_Which(s.Struct.Uint16(0)) +} +func (s CertMgmt) SetUnset() { + s.Struct.SetUint16(0, 0) + +} + +func (s CertMgmt) CertChainReq() (CertChainReq, error) { + if s.Struct.Uint16(0) != 1 { + panic("Which() != certChainReq") + } + p, err := s.Struct.Ptr(0) + return CertChainReq{Struct: p.Struct()}, err +} + +func (s CertMgmt) HasCertChainReq() bool { + if s.Struct.Uint16(0) != 1 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertMgmt) SetCertChainReq(v CertChainReq) error { + s.Struct.SetUint16(0, 1) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewCertChainReq sets the certChainReq field to a newly +// allocated CertChainReq struct, preferring placement in s's segment. +func (s CertMgmt) NewCertChainReq() (CertChainReq, error) { + s.Struct.SetUint16(0, 1) + ss, err := NewCertChainReq(s.Struct.Segment()) + if err != nil { + return CertChainReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CertMgmt) CertChain() (CertChain, error) { + if s.Struct.Uint16(0) != 2 { + panic("Which() != certChain") + } + p, err := s.Struct.Ptr(0) + return CertChain{Struct: p.Struct()}, err +} + +func (s CertMgmt) HasCertChain() bool { + if s.Struct.Uint16(0) != 2 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertMgmt) SetCertChain(v CertChain) error { + s.Struct.SetUint16(0, 2) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewCertChain sets the certChain field to a newly +// allocated CertChain struct, preferring placement in s's segment. +func (s CertMgmt) NewCertChain() (CertChain, error) { + s.Struct.SetUint16(0, 2) + ss, err := NewCertChain(s.Struct.Segment()) + if err != nil { + return CertChain{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CertMgmt) TrcReq() (TRCReq, error) { + if s.Struct.Uint16(0) != 3 { + panic("Which() != trcReq") + } + p, err := s.Struct.Ptr(0) + return TRCReq{Struct: p.Struct()}, err +} + +func (s CertMgmt) HasTrcReq() bool { + if s.Struct.Uint16(0) != 3 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertMgmt) SetTrcReq(v TRCReq) error { + s.Struct.SetUint16(0, 3) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewTrcReq sets the trcReq field to a newly +// allocated TRCReq struct, preferring placement in s's segment. +func (s CertMgmt) NewTrcReq() (TRCReq, error) { + s.Struct.SetUint16(0, 3) + ss, err := NewTRCReq(s.Struct.Segment()) + if err != nil { + return TRCReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CertMgmt) Trc() (TRC, error) { + if s.Struct.Uint16(0) != 4 { + panic("Which() != trc") + } + p, err := s.Struct.Ptr(0) + return TRC{Struct: p.Struct()}, err +} + +func (s CertMgmt) HasTrc() bool { + if s.Struct.Uint16(0) != 4 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertMgmt) SetTrc(v TRC) error { + s.Struct.SetUint16(0, 4) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewTrc sets the trc field to a newly +// allocated TRC struct, preferring placement in s's segment. +func (s CertMgmt) NewTrc() (TRC, error) { + s.Struct.SetUint16(0, 4) + ss, err := NewTRC(s.Struct.Segment()) + if err != nil { + return TRC{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CertMgmt) CertChainIssReq() (CertChainIssReq, error) { + if s.Struct.Uint16(0) != 5 { + panic("Which() != certChainIssReq") + } + p, err := s.Struct.Ptr(0) + return CertChainIssReq{Struct: p.Struct()}, err +} + +func (s CertMgmt) HasCertChainIssReq() bool { + if s.Struct.Uint16(0) != 5 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertMgmt) SetCertChainIssReq(v CertChainIssReq) error { + s.Struct.SetUint16(0, 5) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewCertChainIssReq sets the certChainIssReq field to a newly +// allocated CertChainIssReq struct, preferring placement in s's segment. +func (s CertMgmt) NewCertChainIssReq() (CertChainIssReq, error) { + s.Struct.SetUint16(0, 5) + ss, err := NewCertChainIssReq(s.Struct.Segment()) + if err != nil { + return CertChainIssReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CertMgmt) CertChainIssRep() (CertChainIssRep, error) { + if s.Struct.Uint16(0) != 6 { + panic("Which() != certChainIssRep") + } + p, err := s.Struct.Ptr(0) + return CertChainIssRep{Struct: p.Struct()}, err +} + +func (s CertMgmt) HasCertChainIssRep() bool { + if s.Struct.Uint16(0) != 6 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CertMgmt) SetCertChainIssRep(v CertChainIssRep) error { + s.Struct.SetUint16(0, 6) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewCertChainIssRep sets the certChainIssRep field to a newly +// allocated CertChainIssRep struct, preferring placement in s's segment. +func (s CertMgmt) NewCertChainIssRep() (CertChainIssRep, error) { + s.Struct.SetUint16(0, 6) + ss, err := NewCertChainIssRep(s.Struct.Segment()) + if err != nil { + return CertChainIssRep{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// CertMgmt_List is a list of CertMgmt. +type CertMgmt_List struct{ capnp.List } + +// NewCertMgmt creates a new list of CertMgmt. +func NewCertMgmt_List(s *capnp.Segment, sz int32) (CertMgmt_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return CertMgmt_List{l}, err +} + +func (s CertMgmt_List) At(i int) CertMgmt { return CertMgmt{s.List.Struct(i)} } + +func (s CertMgmt_List) Set(i int, v CertMgmt) error { return s.List.SetStruct(i, v.Struct) } + +func (s CertMgmt_List) String() string { + str, _ := text.MarshalList(0xa19070b486ecd839, s.List) + return str +} + +// CertMgmt_Promise is a wrapper for a CertMgmt promised by a client call. +type CertMgmt_Promise struct{ *capnp.Pipeline } + +func (p CertMgmt_Promise) Struct() (CertMgmt, error) { + s, err := p.Pipeline.Struct() + return CertMgmt{s}, err +} + +func (p CertMgmt_Promise) CertChainReq() CertChainReq_Promise { + return CertChainReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CertMgmt_Promise) CertChain() CertChain_Promise { + return CertChain_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CertMgmt_Promise) TrcReq() TRCReq_Promise { + return TRCReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CertMgmt_Promise) Trc() TRC_Promise { + return TRC_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CertMgmt_Promise) CertChainIssReq() CertChainIssReq_Promise { + return CertChainIssReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CertMgmt_Promise) CertChainIssRep() CertChainIssRep_Promise { + return CertChainIssRep_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +const schema_ec3b2b10a5e23975 = "x\xda\x94\x93OH\x14o\x18\xc7\x9f\xef\xfb\xce\xee\xfe" + + "\xf6\x87\x833\xecT\x04\xc6\x92\x10\x81A\xa4\x9e4b" + + "\xad\xcd\x83\xa0\xe4\xbbx\x08:\xc42\x0e\xeeF\x8e\xeb" + + "\xceh\x7f\x0e\x16\x1d\xba\xd6!:\x04\x1d\x0a\x87" + +func init() { + schemas.Register(schema_ec3b2b10a5e23975, + 0x9aee2af152a5f7d7, + 0xa19070b486ecd839, + 0xadadc71f7e190917, + 0xb2de94224c009676, + 0xc464d1e0777e54d3, + 0xc95b16276878cfc1, + 0xd4c43f7ac10a9dbc) +} diff --git a/go/proto/common.capnp.go b/go/proto/common.capnp.go new file mode 100644 index 0000000000..c0d3ef6c99 --- /dev/null +++ b/go/proto/common.capnp.go @@ -0,0 +1,192 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type LinkType uint16 + +// LinkType_TypeID is the unique identifier for the type LinkType. +const LinkType_TypeID = 0x916c98f48c9bbb64 + +// Values of LinkType. +const ( + LinkType_unset LinkType = 0 + LinkType_core LinkType = 1 + LinkType_parent LinkType = 2 + LinkType_child LinkType = 3 + LinkType_peer LinkType = 4 +) + +// String returns the enum's constant name. +func (c LinkType) String() string { + switch c { + case LinkType_unset: + return "unset" + case LinkType_core: + return "core" + case LinkType_parent: + return "parent" + case LinkType_child: + return "child" + case LinkType_peer: + return "peer" + + default: + return "" + } +} + +// LinkTypeFromString returns the enum value with a name, +// or the zero value if there's no such value. +func LinkTypeFromString(c string) LinkType { + switch c { + case "unset": + return LinkType_unset + case "core": + return LinkType_core + case "parent": + return LinkType_parent + case "child": + return LinkType_child + case "peer": + return LinkType_peer + + default: + return 0 + } +} + +type LinkType_List struct{ capnp.List } + +func NewLinkType_List(s *capnp.Segment, sz int32) (LinkType_List, error) { + l, err := capnp.NewUInt16List(s, sz) + return LinkType_List{l.List}, err +} + +func (l LinkType_List) At(i int) LinkType { + ul := capnp.UInt16List{List: l.List} + return LinkType(ul.At(i)) +} + +func (l LinkType_List) Set(i int, v LinkType) { + ul := capnp.UInt16List{List: l.List} + ul.Set(i, uint16(v)) +} + +type ServiceType uint16 + +// ServiceType_TypeID is the unique identifier for the type ServiceType. +const ServiceType_TypeID = 0xe2522d291bd06774 + +// Values of ServiceType. +const ( + ServiceType_unset ServiceType = 0 + ServiceType_bs ServiceType = 1 + ServiceType_ps ServiceType = 2 + ServiceType_cs ServiceType = 3 + ServiceType_sb ServiceType = 4 + ServiceType_ds ServiceType = 5 + ServiceType_br ServiceType = 6 + ServiceType_sig ServiceType = 7 + ServiceType_hps ServiceType = 8 +) + +// String returns the enum's constant name. +func (c ServiceType) String() string { + switch c { + case ServiceType_unset: + return "unset" + case ServiceType_bs: + return "bs" + case ServiceType_ps: + return "ps" + case ServiceType_cs: + return "cs" + case ServiceType_sb: + return "sb" + case ServiceType_ds: + return "ds" + case ServiceType_br: + return "br" + case ServiceType_sig: + return "sig" + case ServiceType_hps: + return "hps" + + default: + return "" + } +} + +// ServiceTypeFromString returns the enum value with a name, +// or the zero value if there's no such value. +func ServiceTypeFromString(c string) ServiceType { + switch c { + case "unset": + return ServiceType_unset + case "bs": + return ServiceType_bs + case "ps": + return ServiceType_ps + case "cs": + return ServiceType_cs + case "sb": + return ServiceType_sb + case "ds": + return ServiceType_ds + case "br": + return ServiceType_br + case "sig": + return ServiceType_sig + case "hps": + return ServiceType_hps + + default: + return 0 + } +} + +type ServiceType_List struct{ capnp.List } + +func NewServiceType_List(s *capnp.Segment, sz int32) (ServiceType_List, error) { + l, err := capnp.NewUInt16List(s, sz) + return ServiceType_List{l.List}, err +} + +func (l ServiceType_List) At(i int) ServiceType { + ul := capnp.UInt16List{List: l.List} + return ServiceType(ul.At(i)) +} + +func (l ServiceType_List) Set(i int, v ServiceType) { + ul := capnp.UInt16List{List: l.List} + ul.Set(i, uint16(v)) +} + +const schema_fa01960eced2b529 = "x\xda\x12\x88u`\x12d\xdd\xce\xc0\x10\xc8\xc1\xca\xf6" + + "?e\xf7\xec\x9e/3r&2\x08\xf22\xfd\xd7\xdc" + + "z\xe9\x1c\xdf4\xc6_\x0c\x0c\x8c\x82\x8e\x9b\x04=\xd9" + + "\x19\x18\x04]\xeb\x19\x18\xff\x97\xa4_\x90\xd6\xd4\x0dz" + + "\x84\xa1\xaa\xf2\x94`+HU\xe3}\x06\xc6\xff\xc9\xf9" + + "\xb9\xb9\xf9yz\xc9\x8c\x89\x05y\x05V>\x99y\xf2" + + "\xd9!\x95\x05\xa9\x01\x8c\x8c\x81\"\x8cL\x0c\x0c\x82\xa6" + + "F\x0c\x0c\x8c\x8c\x82\xbaZ\x0c\x0c\x8cL\x82\xaaV\x0c" + + "\x0c\x8c\xcc\x82\xb2 A\x16AQ-\x06\x06\xf9\xd2\xbc" + + "\xe2\xd4\x12\xfe\xe4\xfc\xa2T\xfb\x82\xc4\xa2\xd4\xbc\x12\xf9" + + "\xe4\x8c\xcc\x9c\x14\xfe\x82\xd4\xd4\"\xb8\xf1L`\xe3\x83" + + "S\x8b\xca2\x93SA\x1600\x80\xacP\x01[\x91" + + "\x0a\xb1\"V\x0alE\xa8\x14\xd8\x0a_)\xb0\x15\xae" + + " \x8aU\xd0\x16D\xb1\x09\x9a\x82(vA]%\x06" + + "\x06F\x0eAU%\x98\xf5\xccI\xc5\xcc\x05\xc5\xcc\xc9" + + "\xc5\xcc\xc5I\xcc)\xc5\xccIE\xec\xc5\x99\xe9\xec\x19" + + "\x05\xc5\x80\x00\x00\x00\xff\xffj\xfcLl" + +func init() { + schemas.Register(schema_fa01960eced2b529, + 0x916c98f48c9bbb64, + 0xe2522d291bd06774) +} diff --git a/go/proto/ctrl_extn.capnp.go b/go/proto/ctrl_extn.capnp.go new file mode 100644 index 0000000000..06a355f846 --- /dev/null +++ b/go/proto/ctrl_extn.capnp.go @@ -0,0 +1,188 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type CtrlExtnDataList struct{ capnp.Struct } + +// CtrlExtnDataList_TypeID is the unique identifier for the type CtrlExtnDataList. +const CtrlExtnDataList_TypeID = 0xcd601dbe8602c166 + +func NewCtrlExtnDataList(s *capnp.Segment) (CtrlExtnDataList, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CtrlExtnDataList{st}, err +} + +func NewRootCtrlExtnDataList(s *capnp.Segment) (CtrlExtnDataList, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return CtrlExtnDataList{st}, err +} + +func ReadRootCtrlExtnDataList(msg *capnp.Message) (CtrlExtnDataList, error) { + root, err := msg.RootPtr() + return CtrlExtnDataList{root.Struct()}, err +} + +func (s CtrlExtnDataList) String() string { + str, _ := text.Marshal(0xcd601dbe8602c166, s.Struct) + return str +} + +func (s CtrlExtnDataList) Items() (CtrlExtnData_List, error) { + p, err := s.Struct.Ptr(0) + return CtrlExtnData_List{List: p.List()}, err +} + +func (s CtrlExtnDataList) HasItems() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlExtnDataList) SetItems(v CtrlExtnData_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewItems sets the items field to a newly +// allocated CtrlExtnData_List, preferring placement in s's segment. +func (s CtrlExtnDataList) NewItems(n int32) (CtrlExtnData_List, error) { + l, err := NewCtrlExtnData_List(s.Struct.Segment(), n) + if err != nil { + return CtrlExtnData_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// CtrlExtnDataList_List is a list of CtrlExtnDataList. +type CtrlExtnDataList_List struct{ capnp.List } + +// NewCtrlExtnDataList creates a new list of CtrlExtnDataList. +func NewCtrlExtnDataList_List(s *capnp.Segment, sz int32) (CtrlExtnDataList_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return CtrlExtnDataList_List{l}, err +} + +func (s CtrlExtnDataList_List) At(i int) CtrlExtnDataList { return CtrlExtnDataList{s.List.Struct(i)} } + +func (s CtrlExtnDataList_List) Set(i int, v CtrlExtnDataList) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s CtrlExtnDataList_List) String() string { + str, _ := text.MarshalList(0xcd601dbe8602c166, s.List) + return str +} + +// CtrlExtnDataList_Promise is a wrapper for a CtrlExtnDataList promised by a client call. +type CtrlExtnDataList_Promise struct{ *capnp.Pipeline } + +func (p CtrlExtnDataList_Promise) Struct() (CtrlExtnDataList, error) { + s, err := p.Pipeline.Struct() + return CtrlExtnDataList{s}, err +} + +type CtrlExtnData struct{ capnp.Struct } + +// CtrlExtnData_TypeID is the unique identifier for the type CtrlExtnData. +const CtrlExtnData_TypeID = 0xbd3bde9856b0a03f + +func NewCtrlExtnData(s *capnp.Segment) (CtrlExtnData, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return CtrlExtnData{st}, err +} + +func NewRootCtrlExtnData(s *capnp.Segment) (CtrlExtnData, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return CtrlExtnData{st}, err +} + +func ReadRootCtrlExtnData(msg *capnp.Message) (CtrlExtnData, error) { + root, err := msg.RootPtr() + return CtrlExtnData{root.Struct()}, err +} + +func (s CtrlExtnData) String() string { + str, _ := text.Marshal(0xbd3bde9856b0a03f, s.Struct) + return str +} + +func (s CtrlExtnData) Type() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s CtrlExtnData) HasType() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlExtnData) SetType(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s CtrlExtnData) Data() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s CtrlExtnData) HasData() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s CtrlExtnData) SetData(v []byte) error { + return s.Struct.SetData(1, v) +} + +// CtrlExtnData_List is a list of CtrlExtnData. +type CtrlExtnData_List struct{ capnp.List } + +// NewCtrlExtnData creates a new list of CtrlExtnData. +func NewCtrlExtnData_List(s *capnp.Segment, sz int32) (CtrlExtnData_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return CtrlExtnData_List{l}, err +} + +func (s CtrlExtnData_List) At(i int) CtrlExtnData { return CtrlExtnData{s.List.Struct(i)} } + +func (s CtrlExtnData_List) Set(i int, v CtrlExtnData) error { return s.List.SetStruct(i, v.Struct) } + +func (s CtrlExtnData_List) String() string { + str, _ := text.MarshalList(0xbd3bde9856b0a03f, s.List) + return str +} + +// CtrlExtnData_Promise is a wrapper for a CtrlExtnData promised by a client call. +type CtrlExtnData_Promise struct{ *capnp.Pipeline } + +func (p CtrlExtnData_Promise) Struct() (CtrlExtnData, error) { + s, err := p.Pipeline.Struct() + return CtrlExtnData{s}, err +} + +const schema_fa3f5dec2b78a085 = "x\xda\x12\x88p`\x12d\xdd\xce\xc0\x10\xc8\xc1\xca\xf6" + + "\xdf~\xc1\x86\xb0\x19\xf7\xac\xf72\x08\x0a0\xfeo]" + + "P\xa1\xfd&\xd6\xfe\x17\x03+\x13;\x03\x83\xa0\xe3+" + + "A_\x10\xedY\xce\xc0\xf8?\xed S\xdb>\xd9\x84" + + "\xb3h\x0a\x19\xd9\x19\x18\x0c\x97r1\x0an\x05\xa9\xdc" + + "h\xcf\xc0\xf8?\xb9\xa4('>\xb5\xa2\x84)O/" + + "9\xb1 \xaf\xc0\xca\xb9\xa4(\xc7\xb5\xa2$\x8f\xdf%" + + "\xb1$1\x80\x911\x90\x83\x99\x85\x81\x81\x85\x91\x81A" + + "PS\x8b\x81!P\x85\x991\xd0\x80\x89Q\x90\x91Q" + + "\x84\x11$\xa8\x0b\x12\xd4`f\x0c4ab\xe4/\xa9" + + ",He\xe4e`b\xe4e`\xe4OI,I\x84" + + "q\xe0\xf60\xa3\xdb\x03\xb2\xc6'\xb3\xb8\x84\x81\x01d" + + "\x19\x0b\xdc2^#\x90\xa7\x99\x19\x03U\x98\x18\xe53" + + "KRs\x8b\x19\xf9\x18\x18\x03\x98\x19\x19\x05\x10\xe1\xc0" + + "\xc0\x08\x12\x04\x04\x00\x00\xff\xffFkF\xf3" + +func init() { + schemas.Register(schema_fa3f5dec2b78a085, + 0xbd3bde9856b0a03f, + 0xcd601dbe8602c166) +} diff --git a/go/proto/ctrl_pld.capnp.go b/go/proto/ctrl_pld.capnp.go new file mode 100644 index 0000000000..3bb43e5811 --- /dev/null +++ b/go/proto/ctrl_pld.capnp.go @@ -0,0 +1,606 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + strconv "strconv" + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SignedCtrlPld struct{ capnp.Struct } + +// SignedCtrlPld_TypeID is the unique identifier for the type SignedCtrlPld. +const SignedCtrlPld_TypeID = 0xc34ac578b174f099 + +func NewSignedCtrlPld(s *capnp.Segment) (SignedCtrlPld, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SignedCtrlPld{st}, err +} + +func NewRootSignedCtrlPld(s *capnp.Segment) (SignedCtrlPld, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SignedCtrlPld{st}, err +} + +func ReadRootSignedCtrlPld(msg *capnp.Message) (SignedCtrlPld, error) { + root, err := msg.RootPtr() + return SignedCtrlPld{root.Struct()}, err +} + +func (s SignedCtrlPld) String() string { + str, _ := text.Marshal(0xc34ac578b174f099, s.Struct) + return str +} + +func (s SignedCtrlPld) Blob() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s SignedCtrlPld) HasBlob() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SignedCtrlPld) SetBlob(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s SignedCtrlPld) Sign() (Sign, error) { + p, err := s.Struct.Ptr(1) + return Sign{Struct: p.Struct()}, err +} + +func (s SignedCtrlPld) HasSign() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s SignedCtrlPld) SetSign(v Sign) error { + return s.Struct.SetPtr(1, v.Struct.ToPtr()) +} + +// NewSign sets the sign field to a newly +// allocated Sign struct, preferring placement in s's segment. +func (s SignedCtrlPld) NewSign() (Sign, error) { + ss, err := NewSign(s.Struct.Segment()) + if err != nil { + return Sign{}, err + } + err = s.Struct.SetPtr(1, ss.Struct.ToPtr()) + return ss, err +} + +// SignedCtrlPld_List is a list of SignedCtrlPld. +type SignedCtrlPld_List struct{ capnp.List } + +// NewSignedCtrlPld creates a new list of SignedCtrlPld. +func NewSignedCtrlPld_List(s *capnp.Segment, sz int32) (SignedCtrlPld_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return SignedCtrlPld_List{l}, err +} + +func (s SignedCtrlPld_List) At(i int) SignedCtrlPld { return SignedCtrlPld{s.List.Struct(i)} } + +func (s SignedCtrlPld_List) Set(i int, v SignedCtrlPld) error { return s.List.SetStruct(i, v.Struct) } + +func (s SignedCtrlPld_List) String() string { + str, _ := text.MarshalList(0xc34ac578b174f099, s.List) + return str +} + +// SignedCtrlPld_Promise is a wrapper for a SignedCtrlPld promised by a client call. +type SignedCtrlPld_Promise struct{ *capnp.Pipeline } + +func (p SignedCtrlPld_Promise) Struct() (SignedCtrlPld, error) { + s, err := p.Pipeline.Struct() + return SignedCtrlPld{s}, err +} + +func (p SignedCtrlPld_Promise) Sign() Sign_Promise { + return Sign_Promise{Pipeline: p.Pipeline.GetPipeline(1)} +} + +type CtrlPld struct{ capnp.Struct } +type CtrlPld_Which uint16 + +const ( + CtrlPld_Which_unset CtrlPld_Which = 0 + CtrlPld_Which_pcb CtrlPld_Which = 1 + CtrlPld_Which_ifid CtrlPld_Which = 2 + CtrlPld_Which_certMgmt CtrlPld_Which = 3 + CtrlPld_Which_pathMgmt CtrlPld_Which = 4 + CtrlPld_Which_sibra CtrlPld_Which = 5 + CtrlPld_Which_drkeyMgmt CtrlPld_Which = 6 + CtrlPld_Which_sig CtrlPld_Which = 7 + CtrlPld_Which_extn CtrlPld_Which = 8 + CtrlPld_Which_ack CtrlPld_Which = 9 +) + +func (w CtrlPld_Which) String() string { + const s = "unsetpcbifidcertMgmtpathMgmtsibradrkeyMgmtsigextnack" + switch w { + case CtrlPld_Which_unset: + return s[0:5] + case CtrlPld_Which_pcb: + return s[5:8] + case CtrlPld_Which_ifid: + return s[8:12] + case CtrlPld_Which_certMgmt: + return s[12:20] + case CtrlPld_Which_pathMgmt: + return s[20:28] + case CtrlPld_Which_sibra: + return s[28:33] + case CtrlPld_Which_drkeyMgmt: + return s[33:42] + case CtrlPld_Which_sig: + return s[42:45] + case CtrlPld_Which_extn: + return s[45:49] + case CtrlPld_Which_ack: + return s[49:52] + + } + return "CtrlPld_Which(" + strconv.FormatUint(uint64(w), 10) + ")" +} + +// CtrlPld_TypeID is the unique identifier for the type CtrlPld. +const CtrlPld_TypeID = 0x8e6af2c877489f54 + +func NewCtrlPld(s *capnp.Segment) (CtrlPld, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 2}) + return CtrlPld{st}, err +} + +func NewRootCtrlPld(s *capnp.Segment) (CtrlPld, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 2}) + return CtrlPld{st}, err +} + +func ReadRootCtrlPld(msg *capnp.Message) (CtrlPld, error) { + root, err := msg.RootPtr() + return CtrlPld{root.Struct()}, err +} + +func (s CtrlPld) String() string { + str, _ := text.Marshal(0x8e6af2c877489f54, s.Struct) + return str +} + +func (s CtrlPld) Which() CtrlPld_Which { + return CtrlPld_Which(s.Struct.Uint16(0)) +} +func (s CtrlPld) SetUnset() { + s.Struct.SetUint16(0, 0) + +} + +func (s CtrlPld) Pcb() (PCB, error) { + if s.Struct.Uint16(0) != 1 { + panic("Which() != pcb") + } + p, err := s.Struct.Ptr(0) + return PCB{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasPcb() bool { + if s.Struct.Uint16(0) != 1 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetPcb(v PCB) error { + s.Struct.SetUint16(0, 1) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPcb sets the pcb field to a newly +// allocated PCB struct, preferring placement in s's segment. +func (s CtrlPld) NewPcb() (PCB, error) { + s.Struct.SetUint16(0, 1) + ss, err := NewPCB(s.Struct.Segment()) + if err != nil { + return PCB{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) Ifid() (IFID, error) { + if s.Struct.Uint16(0) != 2 { + panic("Which() != ifid") + } + p, err := s.Struct.Ptr(0) + return IFID{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasIfid() bool { + if s.Struct.Uint16(0) != 2 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetIfid(v IFID) error { + s.Struct.SetUint16(0, 2) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewIfid sets the ifid field to a newly +// allocated IFID struct, preferring placement in s's segment. +func (s CtrlPld) NewIfid() (IFID, error) { + s.Struct.SetUint16(0, 2) + ss, err := NewIFID(s.Struct.Segment()) + if err != nil { + return IFID{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) CertMgmt() (CertMgmt, error) { + if s.Struct.Uint16(0) != 3 { + panic("Which() != certMgmt") + } + p, err := s.Struct.Ptr(0) + return CertMgmt{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasCertMgmt() bool { + if s.Struct.Uint16(0) != 3 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetCertMgmt(v CertMgmt) error { + s.Struct.SetUint16(0, 3) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewCertMgmt sets the certMgmt field to a newly +// allocated CertMgmt struct, preferring placement in s's segment. +func (s CtrlPld) NewCertMgmt() (CertMgmt, error) { + s.Struct.SetUint16(0, 3) + ss, err := NewCertMgmt(s.Struct.Segment()) + if err != nil { + return CertMgmt{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) PathMgmt() (PathMgmt, error) { + if s.Struct.Uint16(0) != 4 { + panic("Which() != pathMgmt") + } + p, err := s.Struct.Ptr(0) + return PathMgmt{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasPathMgmt() bool { + if s.Struct.Uint16(0) != 4 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetPathMgmt(v PathMgmt) error { + s.Struct.SetUint16(0, 4) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPathMgmt sets the pathMgmt field to a newly +// allocated PathMgmt struct, preferring placement in s's segment. +func (s CtrlPld) NewPathMgmt() (PathMgmt, error) { + s.Struct.SetUint16(0, 4) + ss, err := NewPathMgmt(s.Struct.Segment()) + if err != nil { + return PathMgmt{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) Sibra() (SibraPayload, error) { + if s.Struct.Uint16(0) != 5 { + panic("Which() != sibra") + } + p, err := s.Struct.Ptr(0) + return SibraPayload{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasSibra() bool { + if s.Struct.Uint16(0) != 5 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetSibra(v SibraPayload) error { + s.Struct.SetUint16(0, 5) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSibra sets the sibra field to a newly +// allocated SibraPayload struct, preferring placement in s's segment. +func (s CtrlPld) NewSibra() (SibraPayload, error) { + s.Struct.SetUint16(0, 5) + ss, err := NewSibraPayload(s.Struct.Segment()) + if err != nil { + return SibraPayload{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) DrkeyMgmt() (DRKeyMgmt, error) { + if s.Struct.Uint16(0) != 6 { + panic("Which() != drkeyMgmt") + } + p, err := s.Struct.Ptr(0) + return DRKeyMgmt{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasDrkeyMgmt() bool { + if s.Struct.Uint16(0) != 6 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetDrkeyMgmt(v DRKeyMgmt) error { + s.Struct.SetUint16(0, 6) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewDrkeyMgmt sets the drkeyMgmt field to a newly +// allocated DRKeyMgmt struct, preferring placement in s's segment. +func (s CtrlPld) NewDrkeyMgmt() (DRKeyMgmt, error) { + s.Struct.SetUint16(0, 6) + ss, err := NewDRKeyMgmt(s.Struct.Segment()) + if err != nil { + return DRKeyMgmt{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) Sig() (SIGCtrl, error) { + if s.Struct.Uint16(0) != 7 { + panic("Which() != sig") + } + p, err := s.Struct.Ptr(0) + return SIGCtrl{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasSig() bool { + if s.Struct.Uint16(0) != 7 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetSig(v SIGCtrl) error { + s.Struct.SetUint16(0, 7) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSig sets the sig field to a newly +// allocated SIGCtrl struct, preferring placement in s's segment. +func (s CtrlPld) NewSig() (SIGCtrl, error) { + s.Struct.SetUint16(0, 7) + ss, err := NewSIGCtrl(s.Struct.Segment()) + if err != nil { + return SIGCtrl{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) Extn() (CtrlExtnDataList, error) { + if s.Struct.Uint16(0) != 8 { + panic("Which() != extn") + } + p, err := s.Struct.Ptr(0) + return CtrlExtnDataList{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasExtn() bool { + if s.Struct.Uint16(0) != 8 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetExtn(v CtrlExtnDataList) error { + s.Struct.SetUint16(0, 8) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewExtn sets the extn field to a newly +// allocated CtrlExtnDataList struct, preferring placement in s's segment. +func (s CtrlPld) NewExtn() (CtrlExtnDataList, error) { + s.Struct.SetUint16(0, 8) + ss, err := NewCtrlExtnDataList(s.Struct.Segment()) + if err != nil { + return CtrlExtnDataList{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) Ack() (Ack, error) { + if s.Struct.Uint16(0) != 9 { + panic("Which() != ack") + } + p, err := s.Struct.Ptr(0) + return Ack{Struct: p.Struct()}, err +} + +func (s CtrlPld) HasAck() bool { + if s.Struct.Uint16(0) != 9 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetAck(v Ack) error { + s.Struct.SetUint16(0, 9) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewAck sets the ack field to a newly +// allocated Ack struct, preferring placement in s's segment. +func (s CtrlPld) NewAck() (Ack, error) { + s.Struct.SetUint16(0, 9) + ss, err := NewAck(s.Struct.Segment()) + if err != nil { + return Ack{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s CtrlPld) ReqId() uint64 { + return s.Struct.Uint64(8) +} + +func (s CtrlPld) SetReqId(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s CtrlPld) TraceId() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s CtrlPld) HasTraceId() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s CtrlPld) SetTraceId(v []byte) error { + return s.Struct.SetData(1, v) +} + +// CtrlPld_List is a list of CtrlPld. +type CtrlPld_List struct{ capnp.List } + +// NewCtrlPld creates a new list of CtrlPld. +func NewCtrlPld_List(s *capnp.Segment, sz int32) (CtrlPld_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 2}, sz) + return CtrlPld_List{l}, err +} + +func (s CtrlPld_List) At(i int) CtrlPld { return CtrlPld{s.List.Struct(i)} } + +func (s CtrlPld_List) Set(i int, v CtrlPld) error { return s.List.SetStruct(i, v.Struct) } + +func (s CtrlPld_List) String() string { + str, _ := text.MarshalList(0x8e6af2c877489f54, s.List) + return str +} + +// CtrlPld_Promise is a wrapper for a CtrlPld promised by a client call. +type CtrlPld_Promise struct{ *capnp.Pipeline } + +func (p CtrlPld_Promise) Struct() (CtrlPld, error) { + s, err := p.Pipeline.Struct() + return CtrlPld{s}, err +} + +func (p CtrlPld_Promise) Pcb() PCB_Promise { + return PCB_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) Ifid() IFID_Promise { + return IFID_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) CertMgmt() CertMgmt_Promise { + return CertMgmt_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) PathMgmt() PathMgmt_Promise { + return PathMgmt_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) Sibra() SibraPayload_Promise { + return SibraPayload_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) DrkeyMgmt() DRKeyMgmt_Promise { + return DRKeyMgmt_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) Sig() SIGCtrl_Promise { + return SIGCtrl_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) Extn() CtrlExtnDataList_Promise { + return CtrlExtnDataList_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p CtrlPld_Promise) Ack() Ack_Promise { + return Ack_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +const schema_df42b02816bdc1bf = "x\xdaD\xd2MHTk\x1c\x06\xf0\xe7y\xcf|\xeb" + + "0\xe7p\x0eww\x11..T\xee\xbd\xa8\x08\x97+" + + "\xf7r\xfd\xb8\x92#N8\x1d\x037\xa53s\xc6q" + + "r\x9c\x8eg\x8e\xa8\x10T .\xc3EA\x05\x11\xad" + + "Z\x15\x09\x81\x14X\x89\x04\x12\x04\xd1BZ\x04\xd1\xa2" + + "M\xb40\xe9\xc3\xb4z\xe3\x1dfrw\xf8\xff\xce\xfb" + + ">\xff\x17\x1e}\xbfG\x18\xc15 \x1d\x09\x86\xe4\xe8" + + "\xf5\xc1\xf9\xad\xddS\x17\x90NP\xc8\x87\x1b\xeb\xbf\xb4" + + "\xdc\xe9{\x85\x01\x11\x8e\x01F\xef}#\x19\x06:\x06" + + "n\x0aP^\xd9\xf1W\x17\x1e\x0fm\xc2H\xf0\xf0\xd7" + + "\xa0\x08\x03fP{k\x1a\x9a\xfa\x8ak\xf3\xa0\xcc\xf9" + + "^i\xdc-9\xfc3\x97q\xcbnw\xff\x7f\xbeW" + + "\x1a)9#d\xba]\x0b4J\x19 `\xf6\xb2\x13" + + "\xb0\xff\xa1F{\x90\x82q~\x97\x16\x15\x0c\xf07\xc0" + + "\xeeQ0\xac@|\x93\x16\x05`&\xd9\x06\xd8\xff+" + + "\x18Q\xa0}\x95\x165\xc0Lq\x08\xb0\x87\x15\x8c)" + + "\x08\x1cH\x8b\x01\xc0<^\x85Q\x05\x13\x0a\x82\xfb\xd2" + + "b\x100OT\xc3\xc7\x148\x0aB_\xa4\xc5\x10`" + + "fx\x0c\xb0'\x14\x94\x14\x84\xf7\xa4E\xf5\xb6bu" + + "+G\x81\xab \xf2YZ\x8c\x00\xe6Lu\xab)\x05" + + ">\x05\x8d\x18-F\x01s\xb6\x1aQR\xf3\x055o" + + "\xa0\xc5\x18`\xce\xb1\x0f\xb0]5?\xa3.\x8a~\x92" + + "\x16\x1b\x00s\xb1\x9a\xe0+8G\xc1\xa6\xb9r%\xef" + + "#\x14vsY\xea\xf2Mz\xf1\xaf\xdc\x91G\xdb\x00" + + "\xa9\x83\x89\xe2d\xd1\xa1.\xef\xb5\x06\xf7\xcc\x83K\xd7" + + "jc\x99\xcb{~\xaa0\xe3\x03\xa0.\xff~\xf1n" + + "\xf9\xae\xbbr\xa3\xaen\xc6\x9f:\xd4'\xcf\xae6\xf6" + + "\xed\xff^\xd7\xa6J1\xebe\xa8\xcb\x95\xcd\xa5\xf1\x8f" + + "[\x1d\xbb\xf5S\x8e7\x9d_L\x15f@_\x9dz" + + "o\x1el\xaf\xad\xaf\xd64\\)\x16\xa8\xcb\xc8\xbf\x9d" + + "\x95\xd6\xe6\x93\xaf\xeb\xeb\xe5\x17\xfc2u9\xb9!\x96" + + "\x1f\xfc:\xf1\xb4\x1e\xe1\xe5g\x93\x0e\xa3\x10\x8c\x82g" + + "}/\x93\xcb'\x1d\xc6!\x18\x07\xc3\x99\xdc4u\xf9" + + "\xf2v\xd7\xf3\xee\xcb\xb7v~>\xa9\xd6'Q\xeb\x93" + + "],\x94\xf3N\xbf\xef%\xea\xad\x8ah\x01@\x95\xca" + + "hm\x03\xd2\xcd\x1a\xd3\xed\x82\x06Y-\x94\xf1\x87\x1a" + + "\xb6hLw\x09&\xb2\xa5\xd3\xd9z`\xa2R,\xa8" + + "-c\xe7\x8f~p.\xa6\x96j\x89?\x02\x00\x00\xff" + + "\xff\xf6\xaa\xbf\x18" + +func init() { + schemas.Register(schema_df42b02816bdc1bf, + 0x8e6af2c877489f54, + 0xc34ac578b174f099) +} diff --git a/go/proto/drkey_mgmt.capnp.go b/go/proto/drkey_mgmt.capnp.go new file mode 100644 index 0000000000..344162dff8 --- /dev/null +++ b/go/proto/drkey_mgmt.capnp.go @@ -0,0 +1,458 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + strconv "strconv" + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type DRKeyReq struct{ capnp.Struct } +type DRKeyReq_flags DRKeyReq + +// DRKeyReq_TypeID is the unique identifier for the type DRKeyReq. +const DRKeyReq_TypeID = 0x9f50d21c9d4ce7ef + +func NewDRKeyReq(s *capnp.Segment) (DRKeyReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 1}) + return DRKeyReq{st}, err +} + +func NewRootDRKeyReq(s *capnp.Segment) (DRKeyReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 1}) + return DRKeyReq{st}, err +} + +func ReadRootDRKeyReq(msg *capnp.Message) (DRKeyReq, error) { + root, err := msg.RootPtr() + return DRKeyReq{root.Struct()}, err +} + +func (s DRKeyReq) String() string { + str, _ := text.Marshal(0x9f50d21c9d4ce7ef, s.Struct) + return str +} + +func (s DRKeyReq) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s DRKeyReq) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s DRKeyReq) Timestamp() uint32 { + return s.Struct.Uint32(8) +} + +func (s DRKeyReq) SetTimestamp(v uint32) { + s.Struct.SetUint32(8, v) +} + +func (s DRKeyReq) Signature() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s DRKeyReq) HasSignature() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s DRKeyReq) SetSignature(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s DRKeyReq) CertVer() uint32 { + return s.Struct.Uint32(12) +} + +func (s DRKeyReq) SetCertVer(v uint32) { + s.Struct.SetUint32(12, v) +} + +func (s DRKeyReq) TrcVer() uint32 { + return s.Struct.Uint32(16) +} + +func (s DRKeyReq) SetTrcVer(v uint32) { + s.Struct.SetUint32(16, v) +} + +func (s DRKeyReq) Flags() DRKeyReq_flags { return DRKeyReq_flags(s) } + +func (s DRKeyReq_flags) Prefetch() bool { + return s.Struct.Bit(160) +} + +func (s DRKeyReq_flags) SetPrefetch(v bool) { + s.Struct.SetBit(160, v) +} + +// DRKeyReq_List is a list of DRKeyReq. +type DRKeyReq_List struct{ capnp.List } + +// NewDRKeyReq creates a new list of DRKeyReq. +func NewDRKeyReq_List(s *capnp.Segment, sz int32) (DRKeyReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 24, PointerCount: 1}, sz) + return DRKeyReq_List{l}, err +} + +func (s DRKeyReq_List) At(i int) DRKeyReq { return DRKeyReq{s.List.Struct(i)} } + +func (s DRKeyReq_List) Set(i int, v DRKeyReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s DRKeyReq_List) String() string { + str, _ := text.MarshalList(0x9f50d21c9d4ce7ef, s.List) + return str +} + +// DRKeyReq_Promise is a wrapper for a DRKeyReq promised by a client call. +type DRKeyReq_Promise struct{ *capnp.Pipeline } + +func (p DRKeyReq_Promise) Struct() (DRKeyReq, error) { + s, err := p.Pipeline.Struct() + return DRKeyReq{s}, err +} + +func (p DRKeyReq_Promise) Flags() DRKeyReq_flags_Promise { return DRKeyReq_flags_Promise{p.Pipeline} } + +// DRKeyReq_flags_Promise is a wrapper for a DRKeyReq_flags promised by a client call. +type DRKeyReq_flags_Promise struct{ *capnp.Pipeline } + +func (p DRKeyReq_flags_Promise) Struct() (DRKeyReq_flags, error) { + s, err := p.Pipeline.Struct() + return DRKeyReq_flags{s}, err +} + +type DRKeyRep struct{ capnp.Struct } + +// DRKeyRep_TypeID is the unique identifier for the type DRKeyRep. +const DRKeyRep_TypeID = 0xc3fe25dd82681d64 + +func NewDRKeyRep(s *capnp.Segment) (DRKeyRep, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 32, PointerCount: 2}) + return DRKeyRep{st}, err +} + +func NewRootDRKeyRep(s *capnp.Segment) (DRKeyRep, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 32, PointerCount: 2}) + return DRKeyRep{st}, err +} + +func ReadRootDRKeyRep(msg *capnp.Message) (DRKeyRep, error) { + root, err := msg.RootPtr() + return DRKeyRep{root.Struct()}, err +} + +func (s DRKeyRep) String() string { + str, _ := text.Marshal(0xc3fe25dd82681d64, s.Struct) + return str +} + +func (s DRKeyRep) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s DRKeyRep) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s DRKeyRep) Timestamp() uint32 { + return s.Struct.Uint32(8) +} + +func (s DRKeyRep) SetTimestamp(v uint32) { + s.Struct.SetUint32(8, v) +} + +func (s DRKeyRep) ExpTime() uint32 { + return s.Struct.Uint32(12) +} + +func (s DRKeyRep) SetExpTime(v uint32) { + s.Struct.SetUint32(12, v) +} + +func (s DRKeyRep) Cipher() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s DRKeyRep) HasCipher() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s DRKeyRep) SetCipher(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s DRKeyRep) Signature() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s DRKeyRep) HasSignature() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s DRKeyRep) SetSignature(v []byte) error { + return s.Struct.SetData(1, v) +} + +func (s DRKeyRep) CertVerSrc() uint32 { + return s.Struct.Uint32(16) +} + +func (s DRKeyRep) SetCertVerSrc(v uint32) { + s.Struct.SetUint32(16, v) +} + +func (s DRKeyRep) CertVerDst() uint32 { + return s.Struct.Uint32(20) +} + +func (s DRKeyRep) SetCertVerDst(v uint32) { + s.Struct.SetUint32(20, v) +} + +func (s DRKeyRep) TrcVer() uint32 { + return s.Struct.Uint32(24) +} + +func (s DRKeyRep) SetTrcVer(v uint32) { + s.Struct.SetUint32(24, v) +} + +// DRKeyRep_List is a list of DRKeyRep. +type DRKeyRep_List struct{ capnp.List } + +// NewDRKeyRep creates a new list of DRKeyRep. +func NewDRKeyRep_List(s *capnp.Segment, sz int32) (DRKeyRep_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 32, PointerCount: 2}, sz) + return DRKeyRep_List{l}, err +} + +func (s DRKeyRep_List) At(i int) DRKeyRep { return DRKeyRep{s.List.Struct(i)} } + +func (s DRKeyRep_List) Set(i int, v DRKeyRep) error { return s.List.SetStruct(i, v.Struct) } + +func (s DRKeyRep_List) String() string { + str, _ := text.MarshalList(0xc3fe25dd82681d64, s.List) + return str +} + +// DRKeyRep_Promise is a wrapper for a DRKeyRep promised by a client call. +type DRKeyRep_Promise struct{ *capnp.Pipeline } + +func (p DRKeyRep_Promise) Struct() (DRKeyRep, error) { + s, err := p.Pipeline.Struct() + return DRKeyRep{s}, err +} + +type DRKeyMgmt struct{ capnp.Struct } +type DRKeyMgmt_Which uint16 + +const ( + DRKeyMgmt_Which_unset DRKeyMgmt_Which = 0 + DRKeyMgmt_Which_drkeyReq DRKeyMgmt_Which = 1 + DRKeyMgmt_Which_drkeyRep DRKeyMgmt_Which = 2 +) + +func (w DRKeyMgmt_Which) String() string { + const s = "unsetdrkeyReqdrkeyRep" + switch w { + case DRKeyMgmt_Which_unset: + return s[0:5] + case DRKeyMgmt_Which_drkeyReq: + return s[5:13] + case DRKeyMgmt_Which_drkeyRep: + return s[13:21] + + } + return "DRKeyMgmt_Which(" + strconv.FormatUint(uint64(w), 10) + ")" +} + +// DRKeyMgmt_TypeID is the unique identifier for the type DRKeyMgmt. +const DRKeyMgmt_TypeID = 0xb1bdb7d6fb13f1ca + +func NewDRKeyMgmt(s *capnp.Segment) (DRKeyMgmt, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return DRKeyMgmt{st}, err +} + +func NewRootDRKeyMgmt(s *capnp.Segment) (DRKeyMgmt, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return DRKeyMgmt{st}, err +} + +func ReadRootDRKeyMgmt(msg *capnp.Message) (DRKeyMgmt, error) { + root, err := msg.RootPtr() + return DRKeyMgmt{root.Struct()}, err +} + +func (s DRKeyMgmt) String() string { + str, _ := text.Marshal(0xb1bdb7d6fb13f1ca, s.Struct) + return str +} + +func (s DRKeyMgmt) Which() DRKeyMgmt_Which { + return DRKeyMgmt_Which(s.Struct.Uint16(0)) +} +func (s DRKeyMgmt) SetUnset() { + s.Struct.SetUint16(0, 0) + +} + +func (s DRKeyMgmt) DrkeyReq() (DRKeyReq, error) { + if s.Struct.Uint16(0) != 1 { + panic("Which() != drkeyReq") + } + p, err := s.Struct.Ptr(0) + return DRKeyReq{Struct: p.Struct()}, err +} + +func (s DRKeyMgmt) HasDrkeyReq() bool { + if s.Struct.Uint16(0) != 1 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s DRKeyMgmt) SetDrkeyReq(v DRKeyReq) error { + s.Struct.SetUint16(0, 1) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewDrkeyReq sets the drkeyReq field to a newly +// allocated DRKeyReq struct, preferring placement in s's segment. +func (s DRKeyMgmt) NewDrkeyReq() (DRKeyReq, error) { + s.Struct.SetUint16(0, 1) + ss, err := NewDRKeyReq(s.Struct.Segment()) + if err != nil { + return DRKeyReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s DRKeyMgmt) DrkeyRep() (DRKeyRep, error) { + if s.Struct.Uint16(0) != 2 { + panic("Which() != drkeyRep") + } + p, err := s.Struct.Ptr(0) + return DRKeyRep{Struct: p.Struct()}, err +} + +func (s DRKeyMgmt) HasDrkeyRep() bool { + if s.Struct.Uint16(0) != 2 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s DRKeyMgmt) SetDrkeyRep(v DRKeyRep) error { + s.Struct.SetUint16(0, 2) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewDrkeyRep sets the drkeyRep field to a newly +// allocated DRKeyRep struct, preferring placement in s's segment. +func (s DRKeyMgmt) NewDrkeyRep() (DRKeyRep, error) { + s.Struct.SetUint16(0, 2) + ss, err := NewDRKeyRep(s.Struct.Segment()) + if err != nil { + return DRKeyRep{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// DRKeyMgmt_List is a list of DRKeyMgmt. +type DRKeyMgmt_List struct{ capnp.List } + +// NewDRKeyMgmt creates a new list of DRKeyMgmt. +func NewDRKeyMgmt_List(s *capnp.Segment, sz int32) (DRKeyMgmt_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return DRKeyMgmt_List{l}, err +} + +func (s DRKeyMgmt_List) At(i int) DRKeyMgmt { return DRKeyMgmt{s.List.Struct(i)} } + +func (s DRKeyMgmt_List) Set(i int, v DRKeyMgmt) error { return s.List.SetStruct(i, v.Struct) } + +func (s DRKeyMgmt_List) String() string { + str, _ := text.MarshalList(0xb1bdb7d6fb13f1ca, s.List) + return str +} + +// DRKeyMgmt_Promise is a wrapper for a DRKeyMgmt promised by a client call. +type DRKeyMgmt_Promise struct{ *capnp.Pipeline } + +func (p DRKeyMgmt_Promise) Struct() (DRKeyMgmt, error) { + s, err := p.Pipeline.Struct() + return DRKeyMgmt{s}, err +} + +func (p DRKeyMgmt_Promise) DrkeyReq() DRKeyReq_Promise { + return DRKeyReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p DRKeyMgmt_Promise) DrkeyRep() DRKeyRep_Promise { + return DRKeyRep_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +const schema_f85d2602085656c1 = "x\xda\x84\x92OHT]\x18\xc6\xdf\xe7}\xef\x9dQ" + + "p`\x0e3\x1f\xc8\xc7\xf7a\x9b\x846\x92\xbas\xa3" + + "\x84B\x7f\x0c<\xa3(D\x12\xc3x\x1c\x87\x1a\xb9\xde" + + "{\x85\xdc$\xb5k\xd1\xaeM\x90d\x90\xe0\xa2(\xa1" + + "\xa8E-\xa2E\x10m\x1a*,\x12\x12\x94Z$\x15" + + "\x14\x08\xa17\x8eW\xc7!\x94v3\xcfy\xce{\x9f" + + "\xe7\xfc\xde\xc3C\xe8\xe2V\xb7\x08\"\x9dv\x13\xd1\xd7" + + "O\xbd3\xffU\xfan\x90V\x90\xe8\xe9\xe0`\x1d7" + + "\x0f\xaf\x93\x8b$\x91\xbaVQsI\xa2\xd6\x9bC " + + "D/\xbeg~\xbd}\xf8d\xc1Z\xb1k\xedAR" + + "\x882\xef\xf0>\xb3joe\x96q\x97\x10\x8d\xfc?" + + "vi\xe9\xe0\xe63\xebvj\x06\xb3\xb5\\\xe4J\xe6" + + "\x8a\xfd\xd5~\x99\x9f\xdb\xd9\x8f\x9b\x0f\x05\x17\xd6\xe6+" + + "\xa4\xff\x85\xec\x86\xfa\x07I\x10\xb5\x0f;\x0cB&\xef" + + "t\xda\xc1\xfeY3u\xa6\\\xe4r\xd8R\xc8{\xe3" + + "^Gw\xee\x84\x99\xca\x19L\xf4\x01\xbaQ\x1c\"\x07" + + "6}\x1b\x91\xbe*\xd0\xb3\x0c\x05\xce\xc2\x8a39\"" + + "}]\xa0\xe7\x19Vc\"5g\xb5[\x02}\x8f\xa1" + + "D\xb2\x10\"u\xe7\x08\x91\x9e\x17\xe8\xfb\x0c\xe58Y" + + "8Dj\xa1\x83H\xdf\x16\xe8G\x0c\xb8\xa8\xc9\xad\x1e" + + "\xb4\x117\x95\x82\x91|\x80zb\xd4\x13\xa2\xb0T6" + + "A\x98/\x13<\xd4\x11\xa3\x8e\x10\x05\xa5\xe2x>\x9c" + + "\xf4\x09\x06)b\xa4\x08\xd3\x05\xe3\x87\x83\xc6\xdf\xf1t" + + "\x86~\xa1\xe6o\xd3\xe8\xb9|1\xd8\xaf\xf6\xc9\xa2\x94" + + "C\xdb\xbbA\x9c\x86(\xda*\xdec\x8bw\x09t/" + + "#\x85\xcd(n~\xec8\x91>*\xd0\x03\x8c\x14o" + + "Dqwm\xd5>\x81>\xcdh\x9a\x1c\x0fLH\x89" + + "\xf8[93ADH\xef\xd2 \xbd\x03 g\xbc" + + "\xf8\xb4\xca\xb9\xf6tO<\x9e\x8dy\xa0\x8a\xe7\x95M" + + "\xf9R\xa0\x17k\xf0\xbc\xb1(^\x0b\xf4G\x86b\x89" + + "3.Y\x14\x8b\x02\xbd\xc2\xc06\x9eeK\xe2\x83@" + + "\x7f\xb6x\x10\xe3Y\xb5\xb7W\x04\xfa\x1bC\xb9N\x16" + + ".\x91Z;E\xa4\xbf\x08\xf4:C%\xdc,\x12D" + + "\xea\xa7\x15\x7f\x08r`\xa8d\"\xbb\xb5\xee\x1bv\xe6" + + "\xba\xa0\xdf\x01\xe3\xef,\xa7\xcdyo\xa0T6Un" + + "\x85\x927f\xfc\x1d\xac{\xa1\x8e\xb6Q\xf7\x93\xf8\x85" + + "\xeaNl\x8b\xdd$A\xb8\xcf\x12T\x9fU\xfe|\xd6" + + "\x89\x96\xad\xfd \xed\x88\x93\x9e\x8d+\xa7,\xd4\x06\x81" + + "ndD\x9eoFMX\x18\xb3\xb8@\x0c\x10~\x07" + + "\x00\x00\xff\xff\x9fS\xf7\xb5" + +func init() { + schemas.Register(schema_f85d2602085656c1, + 0x9f50d21c9d4ce7ef, + 0xb1bdb7d6fb13f1ca, + 0xc3fe25dd82681d64, + 0xd2a8ed7e732926bc) +} diff --git a/go/proto/if_state.capnp.go b/go/proto/if_state.capnp.go new file mode 100644 index 0000000000..8504a10d2a --- /dev/null +++ b/go/proto/if_state.capnp.go @@ -0,0 +1,268 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type IFStateInfo struct{ capnp.Struct } + +// IFStateInfo_TypeID is the unique identifier for the type IFStateInfo. +const IFStateInfo_TypeID = 0xc778fb6f09a6fd58 + +func NewIFStateInfo(s *capnp.Segment) (IFStateInfo, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return IFStateInfo{st}, err +} + +func NewRootIFStateInfo(s *capnp.Segment) (IFStateInfo, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return IFStateInfo{st}, err +} + +func ReadRootIFStateInfo(msg *capnp.Message) (IFStateInfo, error) { + root, err := msg.RootPtr() + return IFStateInfo{root.Struct()}, err +} + +func (s IFStateInfo) String() string { + str, _ := text.Marshal(0xc778fb6f09a6fd58, s.Struct) + return str +} + +func (s IFStateInfo) IfID() uint64 { + return s.Struct.Uint64(0) +} + +func (s IFStateInfo) SetIfID(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s IFStateInfo) Active() bool { + return s.Struct.Bit(64) +} + +func (s IFStateInfo) SetActive(v bool) { + s.Struct.SetBit(64, v) +} + +func (s IFStateInfo) SRevInfo() (SignedBlob, error) { + p, err := s.Struct.Ptr(0) + return SignedBlob{Struct: p.Struct()}, err +} + +func (s IFStateInfo) HasSRevInfo() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s IFStateInfo) SetSRevInfo(v SignedBlob) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSRevInfo sets the sRevInfo field to a newly +// allocated SignedBlob struct, preferring placement in s's segment. +func (s IFStateInfo) NewSRevInfo() (SignedBlob, error) { + ss, err := NewSignedBlob(s.Struct.Segment()) + if err != nil { + return SignedBlob{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// IFStateInfo_List is a list of IFStateInfo. +type IFStateInfo_List struct{ capnp.List } + +// NewIFStateInfo creates a new list of IFStateInfo. +func NewIFStateInfo_List(s *capnp.Segment, sz int32) (IFStateInfo_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}, sz) + return IFStateInfo_List{l}, err +} + +func (s IFStateInfo_List) At(i int) IFStateInfo { return IFStateInfo{s.List.Struct(i)} } + +func (s IFStateInfo_List) Set(i int, v IFStateInfo) error { return s.List.SetStruct(i, v.Struct) } + +func (s IFStateInfo_List) String() string { + str, _ := text.MarshalList(0xc778fb6f09a6fd58, s.List) + return str +} + +// IFStateInfo_Promise is a wrapper for a IFStateInfo promised by a client call. +type IFStateInfo_Promise struct{ *capnp.Pipeline } + +func (p IFStateInfo_Promise) Struct() (IFStateInfo, error) { + s, err := p.Pipeline.Struct() + return IFStateInfo{s}, err +} + +func (p IFStateInfo_Promise) SRevInfo() SignedBlob_Promise { + return SignedBlob_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type IFStateInfos struct{ capnp.Struct } + +// IFStateInfos_TypeID is the unique identifier for the type IFStateInfos. +const IFStateInfos_TypeID = 0xd320ce32f5fc0bbe + +func NewIFStateInfos(s *capnp.Segment) (IFStateInfos, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return IFStateInfos{st}, err +} + +func NewRootIFStateInfos(s *capnp.Segment) (IFStateInfos, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return IFStateInfos{st}, err +} + +func ReadRootIFStateInfos(msg *capnp.Message) (IFStateInfos, error) { + root, err := msg.RootPtr() + return IFStateInfos{root.Struct()}, err +} + +func (s IFStateInfos) String() string { + str, _ := text.Marshal(0xd320ce32f5fc0bbe, s.Struct) + return str +} + +func (s IFStateInfos) Infos() (IFStateInfo_List, error) { + p, err := s.Struct.Ptr(0) + return IFStateInfo_List{List: p.List()}, err +} + +func (s IFStateInfos) HasInfos() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s IFStateInfos) SetInfos(v IFStateInfo_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewInfos sets the infos field to a newly +// allocated IFStateInfo_List, preferring placement in s's segment. +func (s IFStateInfos) NewInfos(n int32) (IFStateInfo_List, error) { + l, err := NewIFStateInfo_List(s.Struct.Segment(), n) + if err != nil { + return IFStateInfo_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// IFStateInfos_List is a list of IFStateInfos. +type IFStateInfos_List struct{ capnp.List } + +// NewIFStateInfos creates a new list of IFStateInfos. +func NewIFStateInfos_List(s *capnp.Segment, sz int32) (IFStateInfos_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return IFStateInfos_List{l}, err +} + +func (s IFStateInfos_List) At(i int) IFStateInfos { return IFStateInfos{s.List.Struct(i)} } + +func (s IFStateInfos_List) Set(i int, v IFStateInfos) error { return s.List.SetStruct(i, v.Struct) } + +func (s IFStateInfos_List) String() string { + str, _ := text.MarshalList(0xd320ce32f5fc0bbe, s.List) + return str +} + +// IFStateInfos_Promise is a wrapper for a IFStateInfos promised by a client call. +type IFStateInfos_Promise struct{ *capnp.Pipeline } + +func (p IFStateInfos_Promise) Struct() (IFStateInfos, error) { + s, err := p.Pipeline.Struct() + return IFStateInfos{s}, err +} + +type IFStateReq struct{ capnp.Struct } + +// IFStateReq_TypeID is the unique identifier for the type IFStateReq. +const IFStateReq_TypeID = 0xe8ed776bc19c66a9 + +func NewIFStateReq(s *capnp.Segment) (IFStateReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return IFStateReq{st}, err +} + +func NewRootIFStateReq(s *capnp.Segment) (IFStateReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return IFStateReq{st}, err +} + +func ReadRootIFStateReq(msg *capnp.Message) (IFStateReq, error) { + root, err := msg.RootPtr() + return IFStateReq{root.Struct()}, err +} + +func (s IFStateReq) String() string { + str, _ := text.Marshal(0xe8ed776bc19c66a9, s.Struct) + return str +} + +func (s IFStateReq) IfID() uint64 { + return s.Struct.Uint64(0) +} + +func (s IFStateReq) SetIfID(v uint64) { + s.Struct.SetUint64(0, v) +} + +// IFStateReq_List is a list of IFStateReq. +type IFStateReq_List struct{ capnp.List } + +// NewIFStateReq creates a new list of IFStateReq. +func NewIFStateReq_List(s *capnp.Segment, sz int32) (IFStateReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return IFStateReq_List{l}, err +} + +func (s IFStateReq_List) At(i int) IFStateReq { return IFStateReq{s.List.Struct(i)} } + +func (s IFStateReq_List) Set(i int, v IFStateReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s IFStateReq_List) String() string { + str, _ := text.MarshalList(0xe8ed776bc19c66a9, s.List) + return str +} + +// IFStateReq_Promise is a wrapper for a IFStateReq promised by a client call. +type IFStateReq_Promise struct{ *capnp.Pipeline } + +func (p IFStateReq_Promise) Struct() (IFStateReq, error) { + s, err := p.Pipeline.Struct() + return IFStateReq{s}, err +} + +const schema_e6d9e9e231c09f51 = "x\xda|\x90\xbfJ+A\x18\xc5\xcf\x99\xdd\xdc\xdcp" + + "s\xef\xee\x904\xb7\x10-\xacR\x08I#\xa4I\x8a" + + "\xa8\xacD\xc8D\x84t\x12\xc2\x0e,\xe2ndc\xd4" + + "\x07\x10_BH'X\xf9\x06\xa2\x95\x9d\x85VZF" + + "\x10-,m\xfc\xc3\xca\x04Q\x09h5\xf3\x1d~\xfc" + + "8\xdf\xe7\xeeUE1\xe5\x10P\xd9\xd4\xaf\xa4\xf5z" + + "\x90\x89\x9e\xb7\xcf\xa0\x1c\x8aD\x0dN\x8a\xc3\xfb\xab[" + + "\xa4\x98\x06\xe4\xfa\xb5\xdc1\xef\xe6\x11\x98\x1c\xffyy" + + ",\x9dO]B:\x1c\x03s\x92\xc3\xdc\xc4\xe8\xf7\x9f" + + "\x1509\xd4\xfb\xa7k[\x0fw\xc6\xfa\x05\xb6\x0d\xe1" + + "\xf1\"\xb72b\xd5\x88\x0d\xf4j\xdck\xf7|1\xd3" + + "iw\xc3n\xd9\x9b_6\xa3\x17Z:j\x90*k" + + "\xd9\x80M@\xce\x15\x00U\xb5\xa8\xea\x82\x92\xd5\xbf(3\xdd\xd3\x8d\x91\x93\x81\x89\x91\x93" + + "\x81\x11\x10\x00\x00\xff\xffD\x9f\x18\x15" + +func init() { + schemas.Register(schema_9cb1ca08a160c787, + 0x9d95fb13f80529b9) +} diff --git a/go/proto/path_mgmt.capnp.go b/go/proto/path_mgmt.capnp.go new file mode 100644 index 0000000000..15446c469f --- /dev/null +++ b/go/proto/path_mgmt.capnp.go @@ -0,0 +1,2105 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + strconv "strconv" + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SegReq struct{ capnp.Struct } +type SegReq_flags SegReq + +// SegReq_TypeID is the unique identifier for the type SegReq. +const SegReq_TypeID = 0x9d0135027d04861e + +func NewSegReq(s *capnp.Segment) (SegReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 0}) + return SegReq{st}, err +} + +func NewRootSegReq(s *capnp.Segment) (SegReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 0}) + return SegReq{st}, err +} + +func ReadRootSegReq(msg *capnp.Message) (SegReq, error) { + root, err := msg.RootPtr() + return SegReq{root.Struct()}, err +} + +func (s SegReq) String() string { + str, _ := text.Marshal(0x9d0135027d04861e, s.Struct) + return str +} + +func (s SegReq) SrcIA() uint64 { + return s.Struct.Uint64(0) +} + +func (s SegReq) SetSrcIA(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s SegReq) DstIA() uint64 { + return s.Struct.Uint64(8) +} + +func (s SegReq) SetDstIA(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s SegReq) Flags() SegReq_flags { return SegReq_flags(s) } + +func (s SegReq_flags) Sibra() bool { + return s.Struct.Bit(128) +} + +func (s SegReq_flags) SetSibra(v bool) { + s.Struct.SetBit(128, v) +} + +func (s SegReq_flags) CacheOnly() bool { + return s.Struct.Bit(129) +} + +func (s SegReq_flags) SetCacheOnly(v bool) { + s.Struct.SetBit(129, v) +} + +// SegReq_List is a list of SegReq. +type SegReq_List struct{ capnp.List } + +// NewSegReq creates a new list of SegReq. +func NewSegReq_List(s *capnp.Segment, sz int32) (SegReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 24, PointerCount: 0}, sz) + return SegReq_List{l}, err +} + +func (s SegReq_List) At(i int) SegReq { return SegReq{s.List.Struct(i)} } + +func (s SegReq_List) Set(i int, v SegReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s SegReq_List) String() string { + str, _ := text.MarshalList(0x9d0135027d04861e, s.List) + return str +} + +// SegReq_Promise is a wrapper for a SegReq promised by a client call. +type SegReq_Promise struct{ *capnp.Pipeline } + +func (p SegReq_Promise) Struct() (SegReq, error) { + s, err := p.Pipeline.Struct() + return SegReq{s}, err +} + +func (p SegReq_Promise) Flags() SegReq_flags_Promise { return SegReq_flags_Promise{p.Pipeline} } + +// SegReq_flags_Promise is a wrapper for a SegReq_flags promised by a client call. +type SegReq_flags_Promise struct{ *capnp.Pipeline } + +func (p SegReq_flags_Promise) Struct() (SegReq_flags, error) { + s, err := p.Pipeline.Struct() + return SegReq_flags{s}, err +} + +type SegRecs struct{ capnp.Struct } + +// SegRecs_TypeID is the unique identifier for the type SegRecs. +const SegRecs_TypeID = 0x934ba70bfd144ebd + +func NewSegRecs(s *capnp.Segment) (SegRecs, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SegRecs{st}, err +} + +func NewRootSegRecs(s *capnp.Segment) (SegRecs, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SegRecs{st}, err +} + +func ReadRootSegRecs(msg *capnp.Message) (SegRecs, error) { + root, err := msg.RootPtr() + return SegRecs{root.Struct()}, err +} + +func (s SegRecs) String() string { + str, _ := text.Marshal(0x934ba70bfd144ebd, s.Struct) + return str +} + +func (s SegRecs) Recs() (PathSegMeta_List, error) { + p, err := s.Struct.Ptr(0) + return PathSegMeta_List{List: p.List()}, err +} + +func (s SegRecs) HasRecs() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegRecs) SetRecs(v PathSegMeta_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewRecs sets the recs field to a newly +// allocated PathSegMeta_List, preferring placement in s's segment. +func (s SegRecs) NewRecs(n int32) (PathSegMeta_List, error) { + l, err := NewPathSegMeta_List(s.Struct.Segment(), n) + if err != nil { + return PathSegMeta_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +func (s SegRecs) SRevInfos() (SignedBlob_List, error) { + p, err := s.Struct.Ptr(1) + return SignedBlob_List{List: p.List()}, err +} + +func (s SegRecs) HasSRevInfos() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s SegRecs) SetSRevInfos(v SignedBlob_List) error { + return s.Struct.SetPtr(1, v.List.ToPtr()) +} + +// NewSRevInfos sets the sRevInfos field to a newly +// allocated SignedBlob_List, preferring placement in s's segment. +func (s SegRecs) NewSRevInfos(n int32) (SignedBlob_List, error) { + l, err := NewSignedBlob_List(s.Struct.Segment(), n) + if err != nil { + return SignedBlob_List{}, err + } + err = s.Struct.SetPtr(1, l.List.ToPtr()) + return l, err +} + +// SegRecs_List is a list of SegRecs. +type SegRecs_List struct{ capnp.List } + +// NewSegRecs creates a new list of SegRecs. +func NewSegRecs_List(s *capnp.Segment, sz int32) (SegRecs_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return SegRecs_List{l}, err +} + +func (s SegRecs_List) At(i int) SegRecs { return SegRecs{s.List.Struct(i)} } + +func (s SegRecs_List) Set(i int, v SegRecs) error { return s.List.SetStruct(i, v.Struct) } + +func (s SegRecs_List) String() string { + str, _ := text.MarshalList(0x934ba70bfd144ebd, s.List) + return str +} + +// SegRecs_Promise is a wrapper for a SegRecs promised by a client call. +type SegRecs_Promise struct{ *capnp.Pipeline } + +func (p SegRecs_Promise) Struct() (SegRecs, error) { + s, err := p.Pipeline.Struct() + return SegRecs{s}, err +} + +type SegReply struct{ capnp.Struct } + +// SegReply_TypeID is the unique identifier for the type SegReply. +const SegReply_TypeID = 0x9359e1b2db37dbbb + +func NewSegReply(s *capnp.Segment) (SegReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SegReply{st}, err +} + +func NewRootSegReply(s *capnp.Segment) (SegReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SegReply{st}, err +} + +func ReadRootSegReply(msg *capnp.Message) (SegReply, error) { + root, err := msg.RootPtr() + return SegReply{root.Struct()}, err +} + +func (s SegReply) String() string { + str, _ := text.Marshal(0x9359e1b2db37dbbb, s.Struct) + return str +} + +func (s SegReply) Req() (SegReq, error) { + p, err := s.Struct.Ptr(0) + return SegReq{Struct: p.Struct()}, err +} + +func (s SegReply) HasReq() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegReply) SetReq(v SegReq) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewReq sets the req field to a newly +// allocated SegReq struct, preferring placement in s's segment. +func (s SegReply) NewReq() (SegReq, error) { + ss, err := NewSegReq(s.Struct.Segment()) + if err != nil { + return SegReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SegReply) Recs() (SegRecs, error) { + p, err := s.Struct.Ptr(1) + return SegRecs{Struct: p.Struct()}, err +} + +func (s SegReply) HasRecs() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s SegReply) SetRecs(v SegRecs) error { + return s.Struct.SetPtr(1, v.Struct.ToPtr()) +} + +// NewRecs sets the recs field to a newly +// allocated SegRecs struct, preferring placement in s's segment. +func (s SegReply) NewRecs() (SegRecs, error) { + ss, err := NewSegRecs(s.Struct.Segment()) + if err != nil { + return SegRecs{}, err + } + err = s.Struct.SetPtr(1, ss.Struct.ToPtr()) + return ss, err +} + +// SegReply_List is a list of SegReply. +type SegReply_List struct{ capnp.List } + +// NewSegReply creates a new list of SegReply. +func NewSegReply_List(s *capnp.Segment, sz int32) (SegReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return SegReply_List{l}, err +} + +func (s SegReply_List) At(i int) SegReply { return SegReply{s.List.Struct(i)} } + +func (s SegReply_List) Set(i int, v SegReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s SegReply_List) String() string { + str, _ := text.MarshalList(0x9359e1b2db37dbbb, s.List) + return str +} + +// SegReply_Promise is a wrapper for a SegReply promised by a client call. +type SegReply_Promise struct{ *capnp.Pipeline } + +func (p SegReply_Promise) Struct() (SegReply, error) { + s, err := p.Pipeline.Struct() + return SegReply{s}, err +} + +func (p SegReply_Promise) Req() SegReq_Promise { + return SegReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SegReply_Promise) Recs() SegRecs_Promise { + return SegRecs_Promise{Pipeline: p.Pipeline.GetPipeline(1)} +} + +type SegChangesIdReq struct{ capnp.Struct } + +// SegChangesIdReq_TypeID is the unique identifier for the type SegChangesIdReq. +const SegChangesIdReq_TypeID = 0xc88dfa6be7a1d091 + +func NewSegChangesIdReq(s *capnp.Segment) (SegChangesIdReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return SegChangesIdReq{st}, err +} + +func NewRootSegChangesIdReq(s *capnp.Segment) (SegChangesIdReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return SegChangesIdReq{st}, err +} + +func ReadRootSegChangesIdReq(msg *capnp.Message) (SegChangesIdReq, error) { + root, err := msg.RootPtr() + return SegChangesIdReq{root.Struct()}, err +} + +func (s SegChangesIdReq) String() string { + str, _ := text.Marshal(0xc88dfa6be7a1d091, s.Struct) + return str +} + +func (s SegChangesIdReq) LastCheck() uint32 { + return s.Struct.Uint32(0) +} + +func (s SegChangesIdReq) SetLastCheck(v uint32) { + s.Struct.SetUint32(0, v) +} + +// SegChangesIdReq_List is a list of SegChangesIdReq. +type SegChangesIdReq_List struct{ capnp.List } + +// NewSegChangesIdReq creates a new list of SegChangesIdReq. +func NewSegChangesIdReq_List(s *capnp.Segment, sz int32) (SegChangesIdReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return SegChangesIdReq_List{l}, err +} + +func (s SegChangesIdReq_List) At(i int) SegChangesIdReq { return SegChangesIdReq{s.List.Struct(i)} } + +func (s SegChangesIdReq_List) Set(i int, v SegChangesIdReq) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s SegChangesIdReq_List) String() string { + str, _ := text.MarshalList(0xc88dfa6be7a1d091, s.List) + return str +} + +// SegChangesIdReq_Promise is a wrapper for a SegChangesIdReq promised by a client call. +type SegChangesIdReq_Promise struct{ *capnp.Pipeline } + +func (p SegChangesIdReq_Promise) Struct() (SegChangesIdReq, error) { + s, err := p.Pipeline.Struct() + return SegChangesIdReq{s}, err +} + +type SegIds struct{ capnp.Struct } + +// SegIds_TypeID is the unique identifier for the type SegIds. +const SegIds_TypeID = 0xabf979c3f68dae4b + +func NewSegIds(s *capnp.Segment) (SegIds, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SegIds{st}, err +} + +func NewRootSegIds(s *capnp.Segment) (SegIds, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SegIds{st}, err +} + +func ReadRootSegIds(msg *capnp.Message) (SegIds, error) { + root, err := msg.RootPtr() + return SegIds{root.Struct()}, err +} + +func (s SegIds) String() string { + str, _ := text.Marshal(0xabf979c3f68dae4b, s.Struct) + return str +} + +func (s SegIds) SegId() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s SegIds) HasSegId() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegIds) SetSegId(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s SegIds) FullId() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s SegIds) HasFullId() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s SegIds) SetFullId(v []byte) error { + return s.Struct.SetData(1, v) +} + +// SegIds_List is a list of SegIds. +type SegIds_List struct{ capnp.List } + +// NewSegIds creates a new list of SegIds. +func NewSegIds_List(s *capnp.Segment, sz int32) (SegIds_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return SegIds_List{l}, err +} + +func (s SegIds_List) At(i int) SegIds { return SegIds{s.List.Struct(i)} } + +func (s SegIds_List) Set(i int, v SegIds) error { return s.List.SetStruct(i, v.Struct) } + +func (s SegIds_List) String() string { + str, _ := text.MarshalList(0xabf979c3f68dae4b, s.List) + return str +} + +// SegIds_Promise is a wrapper for a SegIds promised by a client call. +type SegIds_Promise struct{ *capnp.Pipeline } + +func (p SegIds_Promise) Struct() (SegIds, error) { + s, err := p.Pipeline.Struct() + return SegIds{s}, err +} + +type SegChangesIdReply struct{ capnp.Struct } + +// SegChangesIdReply_TypeID is the unique identifier for the type SegChangesIdReply. +const SegChangesIdReply_TypeID = 0xbd56ceeaf8c65140 + +func NewSegChangesIdReply(s *capnp.Segment) (SegChangesIdReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SegChangesIdReply{st}, err +} + +func NewRootSegChangesIdReply(s *capnp.Segment) (SegChangesIdReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SegChangesIdReply{st}, err +} + +func ReadRootSegChangesIdReply(msg *capnp.Message) (SegChangesIdReply, error) { + root, err := msg.RootPtr() + return SegChangesIdReply{root.Struct()}, err +} + +func (s SegChangesIdReply) String() string { + str, _ := text.Marshal(0xbd56ceeaf8c65140, s.Struct) + return str +} + +func (s SegChangesIdReply) Ids() (SegIds_List, error) { + p, err := s.Struct.Ptr(0) + return SegIds_List{List: p.List()}, err +} + +func (s SegChangesIdReply) HasIds() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegChangesIdReply) SetIds(v SegIds_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewIds sets the ids field to a newly +// allocated SegIds_List, preferring placement in s's segment. +func (s SegChangesIdReply) NewIds(n int32) (SegIds_List, error) { + l, err := NewSegIds_List(s.Struct.Segment(), n) + if err != nil { + return SegIds_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// SegChangesIdReply_List is a list of SegChangesIdReply. +type SegChangesIdReply_List struct{ capnp.List } + +// NewSegChangesIdReply creates a new list of SegChangesIdReply. +func NewSegChangesIdReply_List(s *capnp.Segment, sz int32) (SegChangesIdReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return SegChangesIdReply_List{l}, err +} + +func (s SegChangesIdReply_List) At(i int) SegChangesIdReply { + return SegChangesIdReply{s.List.Struct(i)} +} + +func (s SegChangesIdReply_List) Set(i int, v SegChangesIdReply) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s SegChangesIdReply_List) String() string { + str, _ := text.MarshalList(0xbd56ceeaf8c65140, s.List) + return str +} + +// SegChangesIdReply_Promise is a wrapper for a SegChangesIdReply promised by a client call. +type SegChangesIdReply_Promise struct{ *capnp.Pipeline } + +func (p SegChangesIdReply_Promise) Struct() (SegChangesIdReply, error) { + s, err := p.Pipeline.Struct() + return SegChangesIdReply{s}, err +} + +type SegChangesReq struct{ capnp.Struct } + +// SegChangesReq_TypeID is the unique identifier for the type SegChangesReq. +const SegChangesReq_TypeID = 0xa7ad0c62a234c68b + +func NewSegChangesReq(s *capnp.Segment) (SegChangesReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SegChangesReq{st}, err +} + +func NewRootSegChangesReq(s *capnp.Segment) (SegChangesReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SegChangesReq{st}, err +} + +func ReadRootSegChangesReq(msg *capnp.Message) (SegChangesReq, error) { + root, err := msg.RootPtr() + return SegChangesReq{root.Struct()}, err +} + +func (s SegChangesReq) String() string { + str, _ := text.Marshal(0xa7ad0c62a234c68b, s.Struct) + return str +} + +func (s SegChangesReq) SegIds() (capnp.DataList, error) { + p, err := s.Struct.Ptr(0) + return capnp.DataList{List: p.List()}, err +} + +func (s SegChangesReq) HasSegIds() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegChangesReq) SetSegIds(v capnp.DataList) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewSegIds sets the segIds field to a newly +// allocated capnp.DataList, preferring placement in s's segment. +func (s SegChangesReq) NewSegIds(n int32) (capnp.DataList, error) { + l, err := capnp.NewDataList(s.Struct.Segment(), n) + if err != nil { + return capnp.DataList{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// SegChangesReq_List is a list of SegChangesReq. +type SegChangesReq_List struct{ capnp.List } + +// NewSegChangesReq creates a new list of SegChangesReq. +func NewSegChangesReq_List(s *capnp.Segment, sz int32) (SegChangesReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return SegChangesReq_List{l}, err +} + +func (s SegChangesReq_List) At(i int) SegChangesReq { return SegChangesReq{s.List.Struct(i)} } + +func (s SegChangesReq_List) Set(i int, v SegChangesReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s SegChangesReq_List) String() string { + str, _ := text.MarshalList(0xa7ad0c62a234c68b, s.List) + return str +} + +// SegChangesReq_Promise is a wrapper for a SegChangesReq promised by a client call. +type SegChangesReq_Promise struct{ *capnp.Pipeline } + +func (p SegChangesReq_Promise) Struct() (SegChangesReq, error) { + s, err := p.Pipeline.Struct() + return SegChangesReq{s}, err +} + +type HPGroupId struct{ capnp.Struct } + +// HPGroupId_TypeID is the unique identifier for the type HPGroupId. +const HPGroupId_TypeID = 0xba21c7133ee44518 + +func NewHPGroupId(s *capnp.Segment) (HPGroupId, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return HPGroupId{st}, err +} + +func NewRootHPGroupId(s *capnp.Segment) (HPGroupId, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return HPGroupId{st}, err +} + +func ReadRootHPGroupId(msg *capnp.Message) (HPGroupId, error) { + root, err := msg.RootPtr() + return HPGroupId{root.Struct()}, err +} + +func (s HPGroupId) String() string { + str, _ := text.Marshal(0xba21c7133ee44518, s.Struct) + return str +} + +func (s HPGroupId) OwnerAS() uint64 { + return s.Struct.Uint64(0) +} + +func (s HPGroupId) SetOwnerAS(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s HPGroupId) GroupId() uint16 { + return s.Struct.Uint16(8) +} + +func (s HPGroupId) SetGroupId(v uint16) { + s.Struct.SetUint16(8, v) +} + +// HPGroupId_List is a list of HPGroupId. +type HPGroupId_List struct{ capnp.List } + +// NewHPGroupId creates a new list of HPGroupId. +func NewHPGroupId_List(s *capnp.Segment, sz int32) (HPGroupId_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}, sz) + return HPGroupId_List{l}, err +} + +func (s HPGroupId_List) At(i int) HPGroupId { return HPGroupId{s.List.Struct(i)} } + +func (s HPGroupId_List) Set(i int, v HPGroupId) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPGroupId_List) String() string { + str, _ := text.MarshalList(0xba21c7133ee44518, s.List) + return str +} + +// HPGroupId_Promise is a wrapper for a HPGroupId promised by a client call. +type HPGroupId_Promise struct{ *capnp.Pipeline } + +func (p HPGroupId_Promise) Struct() (HPGroupId, error) { + s, err := p.Pipeline.Struct() + return HPGroupId{s}, err +} + +type HPSegReq struct{ capnp.Struct } + +// HPSegReq_TypeID is the unique identifier for the type HPSegReq. +const HPSegReq_TypeID = 0x8f51e8717b3fbe1c + +func NewHPSegReq(s *capnp.Segment) (HPSegReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return HPSegReq{st}, err +} + +func NewRootHPSegReq(s *capnp.Segment) (HPSegReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return HPSegReq{st}, err +} + +func ReadRootHPSegReq(msg *capnp.Message) (HPSegReq, error) { + root, err := msg.RootPtr() + return HPSegReq{root.Struct()}, err +} + +func (s HPSegReq) String() string { + str, _ := text.Marshal(0x8f51e8717b3fbe1c, s.Struct) + return str +} + +func (s HPSegReq) DstIA() uint64 { + return s.Struct.Uint64(0) +} + +func (s HPSegReq) SetDstIA(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s HPSegReq) GroupIds() (HPGroupId_List, error) { + p, err := s.Struct.Ptr(0) + return HPGroupId_List{List: p.List()}, err +} + +func (s HPSegReq) HasGroupIds() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HPSegReq) SetGroupIds(v HPGroupId_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewGroupIds sets the groupIds field to a newly +// allocated HPGroupId_List, preferring placement in s's segment. +func (s HPSegReq) NewGroupIds(n int32) (HPGroupId_List, error) { + l, err := NewHPGroupId_List(s.Struct.Segment(), n) + if err != nil { + return HPGroupId_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// HPSegReq_List is a list of HPSegReq. +type HPSegReq_List struct{ capnp.List } + +// NewHPSegReq creates a new list of HPSegReq. +func NewHPSegReq_List(s *capnp.Segment, sz int32) (HPSegReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return HPSegReq_List{l}, err +} + +func (s HPSegReq_List) At(i int) HPSegReq { return HPSegReq{s.List.Struct(i)} } + +func (s HPSegReq_List) Set(i int, v HPSegReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPSegReq_List) String() string { + str, _ := text.MarshalList(0x8f51e8717b3fbe1c, s.List) + return str +} + +// HPSegReq_Promise is a wrapper for a HPSegReq promised by a client call. +type HPSegReq_Promise struct{ *capnp.Pipeline } + +func (p HPSegReq_Promise) Struct() (HPSegReq, error) { + s, err := p.Pipeline.Struct() + return HPSegReq{s}, err +} + +type HPSegRecs struct{ capnp.Struct } + +// HPSegRecs_TypeID is the unique identifier for the type HPSegRecs. +const HPSegRecs_TypeID = 0xa56b96c8b25ce2e1 + +func NewHPSegRecs(s *capnp.Segment) (HPSegRecs, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return HPSegRecs{st}, err +} + +func NewRootHPSegRecs(s *capnp.Segment) (HPSegRecs, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}) + return HPSegRecs{st}, err +} + +func ReadRootHPSegRecs(msg *capnp.Message) (HPSegRecs, error) { + root, err := msg.RootPtr() + return HPSegRecs{root.Struct()}, err +} + +func (s HPSegRecs) String() string { + str, _ := text.Marshal(0xa56b96c8b25ce2e1, s.Struct) + return str +} + +func (s HPSegRecs) GroupId() (HPGroupId, error) { + p, err := s.Struct.Ptr(0) + return HPGroupId{Struct: p.Struct()}, err +} + +func (s HPSegRecs) HasGroupId() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HPSegRecs) SetGroupId(v HPGroupId) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewGroupId sets the groupId field to a newly +// allocated HPGroupId struct, preferring placement in s's segment. +func (s HPSegRecs) NewGroupId() (HPGroupId, error) { + ss, err := NewHPGroupId(s.Struct.Segment()) + if err != nil { + return HPGroupId{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s HPSegRecs) Recs() (PathSegMeta_List, error) { + p, err := s.Struct.Ptr(1) + return PathSegMeta_List{List: p.List()}, err +} + +func (s HPSegRecs) HasRecs() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s HPSegRecs) SetRecs(v PathSegMeta_List) error { + return s.Struct.SetPtr(1, v.List.ToPtr()) +} + +// NewRecs sets the recs field to a newly +// allocated PathSegMeta_List, preferring placement in s's segment. +func (s HPSegRecs) NewRecs(n int32) (PathSegMeta_List, error) { + l, err := NewPathSegMeta_List(s.Struct.Segment(), n) + if err != nil { + return PathSegMeta_List{}, err + } + err = s.Struct.SetPtr(1, l.List.ToPtr()) + return l, err +} + +func (s HPSegRecs) Err() (string, error) { + p, err := s.Struct.Ptr(2) + return p.Text(), err +} + +func (s HPSegRecs) HasErr() bool { + p, err := s.Struct.Ptr(2) + return p.IsValid() || err != nil +} + +func (s HPSegRecs) ErrBytes() ([]byte, error) { + p, err := s.Struct.Ptr(2) + return p.TextBytes(), err +} + +func (s HPSegRecs) SetErr(v string) error { + return s.Struct.SetText(2, v) +} + +// HPSegRecs_List is a list of HPSegRecs. +type HPSegRecs_List struct{ capnp.List } + +// NewHPSegRecs creates a new list of HPSegRecs. +func NewHPSegRecs_List(s *capnp.Segment, sz int32) (HPSegRecs_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 3}, sz) + return HPSegRecs_List{l}, err +} + +func (s HPSegRecs_List) At(i int) HPSegRecs { return HPSegRecs{s.List.Struct(i)} } + +func (s HPSegRecs_List) Set(i int, v HPSegRecs) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPSegRecs_List) String() string { + str, _ := text.MarshalList(0xa56b96c8b25ce2e1, s.List) + return str +} + +// HPSegRecs_Promise is a wrapper for a HPSegRecs promised by a client call. +type HPSegRecs_Promise struct{ *capnp.Pipeline } + +func (p HPSegRecs_Promise) Struct() (HPSegRecs, error) { + s, err := p.Pipeline.Struct() + return HPSegRecs{s}, err +} + +func (p HPSegRecs_Promise) GroupId() HPGroupId_Promise { + return HPGroupId_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type HPSegReply struct{ capnp.Struct } + +// HPSegReply_TypeID is the unique identifier for the type HPSegReply. +const HPSegReply_TypeID = 0xaaf7fd9241668ed6 + +func NewHPSegReply(s *capnp.Segment) (HPSegReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return HPSegReply{st}, err +} + +func NewRootHPSegReply(s *capnp.Segment) (HPSegReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return HPSegReply{st}, err +} + +func ReadRootHPSegReply(msg *capnp.Message) (HPSegReply, error) { + root, err := msg.RootPtr() + return HPSegReply{root.Struct()}, err +} + +func (s HPSegReply) String() string { + str, _ := text.Marshal(0xaaf7fd9241668ed6, s.Struct) + return str +} + +func (s HPSegReply) Recs() (HPSegRecs_List, error) { + p, err := s.Struct.Ptr(0) + return HPSegRecs_List{List: p.List()}, err +} + +func (s HPSegReply) HasRecs() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HPSegReply) SetRecs(v HPSegRecs_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewRecs sets the recs field to a newly +// allocated HPSegRecs_List, preferring placement in s's segment. +func (s HPSegReply) NewRecs(n int32) (HPSegRecs_List, error) { + l, err := NewHPSegRecs_List(s.Struct.Segment(), n) + if err != nil { + return HPSegRecs_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// HPSegReply_List is a list of HPSegReply. +type HPSegReply_List struct{ capnp.List } + +// NewHPSegReply creates a new list of HPSegReply. +func NewHPSegReply_List(s *capnp.Segment, sz int32) (HPSegReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return HPSegReply_List{l}, err +} + +func (s HPSegReply_List) At(i int) HPSegReply { return HPSegReply{s.List.Struct(i)} } + +func (s HPSegReply_List) Set(i int, v HPSegReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPSegReply_List) String() string { + str, _ := text.MarshalList(0xaaf7fd9241668ed6, s.List) + return str +} + +// HPSegReply_Promise is a wrapper for a HPSegReply promised by a client call. +type HPSegReply_Promise struct{ *capnp.Pipeline } + +func (p HPSegReply_Promise) Struct() (HPSegReply, error) { + s, err := p.Pipeline.Struct() + return HPSegReply{s}, err +} + +type HPCfg struct{ capnp.Struct } + +// HPCfg_TypeID is the unique identifier for the type HPCfg. +const HPCfg_TypeID = 0xf307100ab87a1963 + +func NewHPCfg(s *capnp.Segment) (HPCfg, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}) + return HPCfg{st}, err +} + +func NewRootHPCfg(s *capnp.Segment) (HPCfg, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}) + return HPCfg{st}, err +} + +func ReadRootHPCfg(msg *capnp.Message) (HPCfg, error) { + root, err := msg.RootPtr() + return HPCfg{root.Struct()}, err +} + +func (s HPCfg) String() string { + str, _ := text.Marshal(0xf307100ab87a1963, s.Struct) + return str +} + +func (s HPCfg) GroupId() (HPGroupId, error) { + p, err := s.Struct.Ptr(0) + return HPGroupId{Struct: p.Struct()}, err +} + +func (s HPCfg) HasGroupId() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HPCfg) SetGroupId(v HPGroupId) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewGroupId sets the groupId field to a newly +// allocated HPGroupId struct, preferring placement in s's segment. +func (s HPCfg) NewGroupId() (HPGroupId, error) { + ss, err := NewHPGroupId(s.Struct.Segment()) + if err != nil { + return HPGroupId{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s HPCfg) Version() uint32 { + return s.Struct.Uint32(0) +} + +func (s HPCfg) SetVersion(v uint32) { + s.Struct.SetUint32(0, v) +} + +func (s HPCfg) OwnerISD() uint16 { + return s.Struct.Uint16(4) +} + +func (s HPCfg) SetOwnerISD(v uint16) { + s.Struct.SetUint16(4, v) +} + +func (s HPCfg) Writers() (capnp.UInt64List, error) { + p, err := s.Struct.Ptr(1) + return capnp.UInt64List{List: p.List()}, err +} + +func (s HPCfg) HasWriters() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s HPCfg) SetWriters(v capnp.UInt64List) error { + return s.Struct.SetPtr(1, v.List.ToPtr()) +} + +// NewWriters sets the writers field to a newly +// allocated capnp.UInt64List, preferring placement in s's segment. +func (s HPCfg) NewWriters(n int32) (capnp.UInt64List, error) { + l, err := capnp.NewUInt64List(s.Struct.Segment(), n) + if err != nil { + return capnp.UInt64List{}, err + } + err = s.Struct.SetPtr(1, l.List.ToPtr()) + return l, err +} + +func (s HPCfg) Readers() (capnp.UInt64List, error) { + p, err := s.Struct.Ptr(2) + return capnp.UInt64List{List: p.List()}, err +} + +func (s HPCfg) HasReaders() bool { + p, err := s.Struct.Ptr(2) + return p.IsValid() || err != nil +} + +func (s HPCfg) SetReaders(v capnp.UInt64List) error { + return s.Struct.SetPtr(2, v.List.ToPtr()) +} + +// NewReaders sets the readers field to a newly +// allocated capnp.UInt64List, preferring placement in s's segment. +func (s HPCfg) NewReaders(n int32) (capnp.UInt64List, error) { + l, err := capnp.NewUInt64List(s.Struct.Segment(), n) + if err != nil { + return capnp.UInt64List{}, err + } + err = s.Struct.SetPtr(2, l.List.ToPtr()) + return l, err +} + +func (s HPCfg) Registries() (capnp.UInt64List, error) { + p, err := s.Struct.Ptr(3) + return capnp.UInt64List{List: p.List()}, err +} + +func (s HPCfg) HasRegistries() bool { + p, err := s.Struct.Ptr(3) + return p.IsValid() || err != nil +} + +func (s HPCfg) SetRegistries(v capnp.UInt64List) error { + return s.Struct.SetPtr(3, v.List.ToPtr()) +} + +// NewRegistries sets the registries field to a newly +// allocated capnp.UInt64List, preferring placement in s's segment. +func (s HPCfg) NewRegistries(n int32) (capnp.UInt64List, error) { + l, err := capnp.NewUInt64List(s.Struct.Segment(), n) + if err != nil { + return capnp.UInt64List{}, err + } + err = s.Struct.SetPtr(3, l.List.ToPtr()) + return l, err +} + +// HPCfg_List is a list of HPCfg. +type HPCfg_List struct{ capnp.List } + +// NewHPCfg creates a new list of HPCfg. +func NewHPCfg_List(s *capnp.Segment, sz int32) (HPCfg_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 4}, sz) + return HPCfg_List{l}, err +} + +func (s HPCfg_List) At(i int) HPCfg { return HPCfg{s.List.Struct(i)} } + +func (s HPCfg_List) Set(i int, v HPCfg) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPCfg_List) String() string { + str, _ := text.MarshalList(0xf307100ab87a1963, s.List) + return str +} + +// HPCfg_Promise is a wrapper for a HPCfg promised by a client call. +type HPCfg_Promise struct{ *capnp.Pipeline } + +func (p HPCfg_Promise) Struct() (HPCfg, error) { + s, err := p.Pipeline.Struct() + return HPCfg{s}, err +} + +func (p HPCfg_Promise) GroupId() HPGroupId_Promise { + return HPGroupId_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type HPCfgReq struct{ capnp.Struct } + +// HPCfgReq_TypeID is the unique identifier for the type HPCfgReq. +const HPCfgReq_TypeID = 0xd24bad15bb2bab5e + +func NewHPCfgReq(s *capnp.Segment) (HPCfgReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return HPCfgReq{st}, err +} + +func NewRootHPCfgReq(s *capnp.Segment) (HPCfgReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return HPCfgReq{st}, err +} + +func ReadRootHPCfgReq(msg *capnp.Message) (HPCfgReq, error) { + root, err := msg.RootPtr() + return HPCfgReq{root.Struct()}, err +} + +func (s HPCfgReq) String() string { + str, _ := text.Marshal(0xd24bad15bb2bab5e, s.Struct) + return str +} + +func (s HPCfgReq) ChangedSince() uint32 { + return s.Struct.Uint32(0) +} + +func (s HPCfgReq) SetChangedSince(v uint32) { + s.Struct.SetUint32(0, v) +} + +// HPCfgReq_List is a list of HPCfgReq. +type HPCfgReq_List struct{ capnp.List } + +// NewHPCfgReq creates a new list of HPCfgReq. +func NewHPCfgReq_List(s *capnp.Segment, sz int32) (HPCfgReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return HPCfgReq_List{l}, err +} + +func (s HPCfgReq_List) At(i int) HPCfgReq { return HPCfgReq{s.List.Struct(i)} } + +func (s HPCfgReq_List) Set(i int, v HPCfgReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPCfgReq_List) String() string { + str, _ := text.MarshalList(0xd24bad15bb2bab5e, s.List) + return str +} + +// HPCfgReq_Promise is a wrapper for a HPCfgReq promised by a client call. +type HPCfgReq_Promise struct{ *capnp.Pipeline } + +func (p HPCfgReq_Promise) Struct() (HPCfgReq, error) { + s, err := p.Pipeline.Struct() + return HPCfgReq{s}, err +} + +type HPCfgReply struct{ capnp.Struct } + +// HPCfgReply_TypeID is the unique identifier for the type HPCfgReply. +const HPCfgReply_TypeID = 0xb27bf6e10de2aa8c + +func NewHPCfgReply(s *capnp.Segment) (HPCfgReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return HPCfgReply{st}, err +} + +func NewRootHPCfgReply(s *capnp.Segment) (HPCfgReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return HPCfgReply{st}, err +} + +func ReadRootHPCfgReply(msg *capnp.Message) (HPCfgReply, error) { + root, err := msg.RootPtr() + return HPCfgReply{root.Struct()}, err +} + +func (s HPCfgReply) String() string { + str, _ := text.Marshal(0xb27bf6e10de2aa8c, s.Struct) + return str +} + +func (s HPCfgReply) Cfgs() (HPCfg_List, error) { + p, err := s.Struct.Ptr(0) + return HPCfg_List{List: p.List()}, err +} + +func (s HPCfgReply) HasCfgs() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HPCfgReply) SetCfgs(v HPCfg_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewCfgs sets the cfgs field to a newly +// allocated HPCfg_List, preferring placement in s's segment. +func (s HPCfgReply) NewCfgs(n int32) (HPCfg_List, error) { + l, err := NewHPCfg_List(s.Struct.Segment(), n) + if err != nil { + return HPCfg_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// HPCfgReply_List is a list of HPCfgReply. +type HPCfgReply_List struct{ capnp.List } + +// NewHPCfgReply creates a new list of HPCfgReply. +func NewHPCfgReply_List(s *capnp.Segment, sz int32) (HPCfgReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return HPCfgReply_List{l}, err +} + +func (s HPCfgReply_List) At(i int) HPCfgReply { return HPCfgReply{s.List.Struct(i)} } + +func (s HPCfgReply_List) Set(i int, v HPCfgReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s HPCfgReply_List) String() string { + str, _ := text.MarshalList(0xb27bf6e10de2aa8c, s.List) + return str +} + +// HPCfgReply_Promise is a wrapper for a HPCfgReply promised by a client call. +type HPCfgReply_Promise struct{ *capnp.Pipeline } + +func (p HPCfgReply_Promise) Struct() (HPCfgReply, error) { + s, err := p.Pipeline.Struct() + return HPCfgReply{s}, err +} + +type PathMgmt struct{ capnp.Struct } +type PathMgmt_Which uint16 + +const ( + PathMgmt_Which_unset PathMgmt_Which = 0 + PathMgmt_Which_segReq PathMgmt_Which = 1 + PathMgmt_Which_segReply PathMgmt_Which = 2 + PathMgmt_Which_segReg PathMgmt_Which = 3 + PathMgmt_Which_segSync PathMgmt_Which = 4 + PathMgmt_Which_sRevInfo PathMgmt_Which = 5 + PathMgmt_Which_ifStateReq PathMgmt_Which = 6 + PathMgmt_Which_ifStateInfos PathMgmt_Which = 7 + PathMgmt_Which_segChangesIdReq PathMgmt_Which = 8 + PathMgmt_Which_segChangesIdReply PathMgmt_Which = 9 + PathMgmt_Which_segChangesReq PathMgmt_Which = 10 + PathMgmt_Which_segChangesReply PathMgmt_Which = 11 + PathMgmt_Which_hpSegReq PathMgmt_Which = 12 + PathMgmt_Which_hpSegReply PathMgmt_Which = 13 + PathMgmt_Which_hpSegReg PathMgmt_Which = 14 + PathMgmt_Which_hpCfgReq PathMgmt_Which = 15 + PathMgmt_Which_hpCfgReply PathMgmt_Which = 16 +) + +func (w PathMgmt_Which) String() string { + const s = "unsetsegReqsegReplysegRegsegSyncsRevInfoifStateReqifStateInfossegChangesIdReqsegChangesIdReplysegChangesReqsegChangesReplyhpSegReqhpSegReplyhpSegReghpCfgReqhpCfgReply" + switch w { + case PathMgmt_Which_unset: + return s[0:5] + case PathMgmt_Which_segReq: + return s[5:11] + case PathMgmt_Which_segReply: + return s[11:19] + case PathMgmt_Which_segReg: + return s[19:25] + case PathMgmt_Which_segSync: + return s[25:32] + case PathMgmt_Which_sRevInfo: + return s[32:40] + case PathMgmt_Which_ifStateReq: + return s[40:50] + case PathMgmt_Which_ifStateInfos: + return s[50:62] + case PathMgmt_Which_segChangesIdReq: + return s[62:77] + case PathMgmt_Which_segChangesIdReply: + return s[77:94] + case PathMgmt_Which_segChangesReq: + return s[94:107] + case PathMgmt_Which_segChangesReply: + return s[107:122] + case PathMgmt_Which_hpSegReq: + return s[122:130] + case PathMgmt_Which_hpSegReply: + return s[130:140] + case PathMgmt_Which_hpSegReg: + return s[140:148] + case PathMgmt_Which_hpCfgReq: + return s[148:156] + case PathMgmt_Which_hpCfgReply: + return s[156:166] + + } + return "PathMgmt_Which(" + strconv.FormatUint(uint64(w), 10) + ")" +} + +// PathMgmt_TypeID is the unique identifier for the type PathMgmt. +const PathMgmt_TypeID = 0xa12cfa420c9ad0ca + +func NewPathMgmt(s *capnp.Segment) (PathMgmt, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PathMgmt{st}, err +} + +func NewRootPathMgmt(s *capnp.Segment) (PathMgmt, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PathMgmt{st}, err +} + +func ReadRootPathMgmt(msg *capnp.Message) (PathMgmt, error) { + root, err := msg.RootPtr() + return PathMgmt{root.Struct()}, err +} + +func (s PathMgmt) String() string { + str, _ := text.Marshal(0xa12cfa420c9ad0ca, s.Struct) + return str +} + +func (s PathMgmt) Which() PathMgmt_Which { + return PathMgmt_Which(s.Struct.Uint16(0)) +} +func (s PathMgmt) SetUnset() { + s.Struct.SetUint16(0, 0) + +} + +func (s PathMgmt) SegReq() (SegReq, error) { + if s.Struct.Uint16(0) != 1 { + panic("Which() != segReq") + } + p, err := s.Struct.Ptr(0) + return SegReq{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegReq() bool { + if s.Struct.Uint16(0) != 1 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegReq(v SegReq) error { + s.Struct.SetUint16(0, 1) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegReq sets the segReq field to a newly +// allocated SegReq struct, preferring placement in s's segment. +func (s PathMgmt) NewSegReq() (SegReq, error) { + s.Struct.SetUint16(0, 1) + ss, err := NewSegReq(s.Struct.Segment()) + if err != nil { + return SegReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegReply() (SegReply, error) { + if s.Struct.Uint16(0) != 2 { + panic("Which() != segReply") + } + p, err := s.Struct.Ptr(0) + return SegReply{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegReply() bool { + if s.Struct.Uint16(0) != 2 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegReply(v SegReply) error { + s.Struct.SetUint16(0, 2) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegReply sets the segReply field to a newly +// allocated SegReply struct, preferring placement in s's segment. +func (s PathMgmt) NewSegReply() (SegReply, error) { + s.Struct.SetUint16(0, 2) + ss, err := NewSegReply(s.Struct.Segment()) + if err != nil { + return SegReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegReg() (SegRecs, error) { + if s.Struct.Uint16(0) != 3 { + panic("Which() != segReg") + } + p, err := s.Struct.Ptr(0) + return SegRecs{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegReg() bool { + if s.Struct.Uint16(0) != 3 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegReg(v SegRecs) error { + s.Struct.SetUint16(0, 3) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegReg sets the segReg field to a newly +// allocated SegRecs struct, preferring placement in s's segment. +func (s PathMgmt) NewSegReg() (SegRecs, error) { + s.Struct.SetUint16(0, 3) + ss, err := NewSegRecs(s.Struct.Segment()) + if err != nil { + return SegRecs{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegSync() (SegRecs, error) { + if s.Struct.Uint16(0) != 4 { + panic("Which() != segSync") + } + p, err := s.Struct.Ptr(0) + return SegRecs{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegSync() bool { + if s.Struct.Uint16(0) != 4 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegSync(v SegRecs) error { + s.Struct.SetUint16(0, 4) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegSync sets the segSync field to a newly +// allocated SegRecs struct, preferring placement in s's segment. +func (s PathMgmt) NewSegSync() (SegRecs, error) { + s.Struct.SetUint16(0, 4) + ss, err := NewSegRecs(s.Struct.Segment()) + if err != nil { + return SegRecs{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SRevInfo() (SignedBlob, error) { + if s.Struct.Uint16(0) != 5 { + panic("Which() != sRevInfo") + } + p, err := s.Struct.Ptr(0) + return SignedBlob{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSRevInfo() bool { + if s.Struct.Uint16(0) != 5 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSRevInfo(v SignedBlob) error { + s.Struct.SetUint16(0, 5) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSRevInfo sets the sRevInfo field to a newly +// allocated SignedBlob struct, preferring placement in s's segment. +func (s PathMgmt) NewSRevInfo() (SignedBlob, error) { + s.Struct.SetUint16(0, 5) + ss, err := NewSignedBlob(s.Struct.Segment()) + if err != nil { + return SignedBlob{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) IfStateReq() (IFStateReq, error) { + if s.Struct.Uint16(0) != 6 { + panic("Which() != ifStateReq") + } + p, err := s.Struct.Ptr(0) + return IFStateReq{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasIfStateReq() bool { + if s.Struct.Uint16(0) != 6 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetIfStateReq(v IFStateReq) error { + s.Struct.SetUint16(0, 6) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewIfStateReq sets the ifStateReq field to a newly +// allocated IFStateReq struct, preferring placement in s's segment. +func (s PathMgmt) NewIfStateReq() (IFStateReq, error) { + s.Struct.SetUint16(0, 6) + ss, err := NewIFStateReq(s.Struct.Segment()) + if err != nil { + return IFStateReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) IfStateInfos() (IFStateInfos, error) { + if s.Struct.Uint16(0) != 7 { + panic("Which() != ifStateInfos") + } + p, err := s.Struct.Ptr(0) + return IFStateInfos{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasIfStateInfos() bool { + if s.Struct.Uint16(0) != 7 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetIfStateInfos(v IFStateInfos) error { + s.Struct.SetUint16(0, 7) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewIfStateInfos sets the ifStateInfos field to a newly +// allocated IFStateInfos struct, preferring placement in s's segment. +func (s PathMgmt) NewIfStateInfos() (IFStateInfos, error) { + s.Struct.SetUint16(0, 7) + ss, err := NewIFStateInfos(s.Struct.Segment()) + if err != nil { + return IFStateInfos{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegChangesIdReq() (SegChangesIdReq, error) { + if s.Struct.Uint16(0) != 8 { + panic("Which() != segChangesIdReq") + } + p, err := s.Struct.Ptr(0) + return SegChangesIdReq{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegChangesIdReq() bool { + if s.Struct.Uint16(0) != 8 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegChangesIdReq(v SegChangesIdReq) error { + s.Struct.SetUint16(0, 8) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegChangesIdReq sets the segChangesIdReq field to a newly +// allocated SegChangesIdReq struct, preferring placement in s's segment. +func (s PathMgmt) NewSegChangesIdReq() (SegChangesIdReq, error) { + s.Struct.SetUint16(0, 8) + ss, err := NewSegChangesIdReq(s.Struct.Segment()) + if err != nil { + return SegChangesIdReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegChangesIdReply() (SegChangesIdReply, error) { + if s.Struct.Uint16(0) != 9 { + panic("Which() != segChangesIdReply") + } + p, err := s.Struct.Ptr(0) + return SegChangesIdReply{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegChangesIdReply() bool { + if s.Struct.Uint16(0) != 9 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegChangesIdReply(v SegChangesIdReply) error { + s.Struct.SetUint16(0, 9) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegChangesIdReply sets the segChangesIdReply field to a newly +// allocated SegChangesIdReply struct, preferring placement in s's segment. +func (s PathMgmt) NewSegChangesIdReply() (SegChangesIdReply, error) { + s.Struct.SetUint16(0, 9) + ss, err := NewSegChangesIdReply(s.Struct.Segment()) + if err != nil { + return SegChangesIdReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegChangesReq() (SegChangesReq, error) { + if s.Struct.Uint16(0) != 10 { + panic("Which() != segChangesReq") + } + p, err := s.Struct.Ptr(0) + return SegChangesReq{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegChangesReq() bool { + if s.Struct.Uint16(0) != 10 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegChangesReq(v SegChangesReq) error { + s.Struct.SetUint16(0, 10) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegChangesReq sets the segChangesReq field to a newly +// allocated SegChangesReq struct, preferring placement in s's segment. +func (s PathMgmt) NewSegChangesReq() (SegChangesReq, error) { + s.Struct.SetUint16(0, 10) + ss, err := NewSegChangesReq(s.Struct.Segment()) + if err != nil { + return SegChangesReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) SegChangesReply() (SegRecs, error) { + if s.Struct.Uint16(0) != 11 { + panic("Which() != segChangesReply") + } + p, err := s.Struct.Ptr(0) + return SegRecs{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasSegChangesReply() bool { + if s.Struct.Uint16(0) != 11 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetSegChangesReply(v SegRecs) error { + s.Struct.SetUint16(0, 11) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegChangesReply sets the segChangesReply field to a newly +// allocated SegRecs struct, preferring placement in s's segment. +func (s PathMgmt) NewSegChangesReply() (SegRecs, error) { + s.Struct.SetUint16(0, 11) + ss, err := NewSegRecs(s.Struct.Segment()) + if err != nil { + return SegRecs{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) HpSegReq() (HPSegReq, error) { + if s.Struct.Uint16(0) != 12 { + panic("Which() != hpSegReq") + } + p, err := s.Struct.Ptr(0) + return HPSegReq{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasHpSegReq() bool { + if s.Struct.Uint16(0) != 12 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetHpSegReq(v HPSegReq) error { + s.Struct.SetUint16(0, 12) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewHpSegReq sets the hpSegReq field to a newly +// allocated HPSegReq struct, preferring placement in s's segment. +func (s PathMgmt) NewHpSegReq() (HPSegReq, error) { + s.Struct.SetUint16(0, 12) + ss, err := NewHPSegReq(s.Struct.Segment()) + if err != nil { + return HPSegReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) HpSegReply() (HPSegReply, error) { + if s.Struct.Uint16(0) != 13 { + panic("Which() != hpSegReply") + } + p, err := s.Struct.Ptr(0) + return HPSegReply{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasHpSegReply() bool { + if s.Struct.Uint16(0) != 13 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetHpSegReply(v HPSegReply) error { + s.Struct.SetUint16(0, 13) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewHpSegReply sets the hpSegReply field to a newly +// allocated HPSegReply struct, preferring placement in s's segment. +func (s PathMgmt) NewHpSegReply() (HPSegReply, error) { + s.Struct.SetUint16(0, 13) + ss, err := NewHPSegReply(s.Struct.Segment()) + if err != nil { + return HPSegReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) HpSegReg() (HPSegRecs, error) { + if s.Struct.Uint16(0) != 14 { + panic("Which() != hpSegReg") + } + p, err := s.Struct.Ptr(0) + return HPSegRecs{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasHpSegReg() bool { + if s.Struct.Uint16(0) != 14 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetHpSegReg(v HPSegRecs) error { + s.Struct.SetUint16(0, 14) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewHpSegReg sets the hpSegReg field to a newly +// allocated HPSegRecs struct, preferring placement in s's segment. +func (s PathMgmt) NewHpSegReg() (HPSegRecs, error) { + s.Struct.SetUint16(0, 14) + ss, err := NewHPSegRecs(s.Struct.Segment()) + if err != nil { + return HPSegRecs{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) HpCfgReq() (HPCfgReq, error) { + if s.Struct.Uint16(0) != 15 { + panic("Which() != hpCfgReq") + } + p, err := s.Struct.Ptr(0) + return HPCfgReq{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasHpCfgReq() bool { + if s.Struct.Uint16(0) != 15 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetHpCfgReq(v HPCfgReq) error { + s.Struct.SetUint16(0, 15) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewHpCfgReq sets the hpCfgReq field to a newly +// allocated HPCfgReq struct, preferring placement in s's segment. +func (s PathMgmt) NewHpCfgReq() (HPCfgReq, error) { + s.Struct.SetUint16(0, 15) + ss, err := NewHPCfgReq(s.Struct.Segment()) + if err != nil { + return HPCfgReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathMgmt) HpCfgReply() (HPCfgReply, error) { + if s.Struct.Uint16(0) != 16 { + panic("Which() != hpCfgReply") + } + p, err := s.Struct.Ptr(0) + return HPCfgReply{Struct: p.Struct()}, err +} + +func (s PathMgmt) HasHpCfgReply() bool { + if s.Struct.Uint16(0) != 16 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathMgmt) SetHpCfgReply(v HPCfgReply) error { + s.Struct.SetUint16(0, 16) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewHpCfgReply sets the hpCfgReply field to a newly +// allocated HPCfgReply struct, preferring placement in s's segment. +func (s PathMgmt) NewHpCfgReply() (HPCfgReply, error) { + s.Struct.SetUint16(0, 16) + ss, err := NewHPCfgReply(s.Struct.Segment()) + if err != nil { + return HPCfgReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// PathMgmt_List is a list of PathMgmt. +type PathMgmt_List struct{ capnp.List } + +// NewPathMgmt creates a new list of PathMgmt. +func NewPathMgmt_List(s *capnp.Segment, sz int32) (PathMgmt_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return PathMgmt_List{l}, err +} + +func (s PathMgmt_List) At(i int) PathMgmt { return PathMgmt{s.List.Struct(i)} } + +func (s PathMgmt_List) Set(i int, v PathMgmt) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathMgmt_List) String() string { + str, _ := text.MarshalList(0xa12cfa420c9ad0ca, s.List) + return str +} + +// PathMgmt_Promise is a wrapper for a PathMgmt promised by a client call. +type PathMgmt_Promise struct{ *capnp.Pipeline } + +func (p PathMgmt_Promise) Struct() (PathMgmt, error) { + s, err := p.Pipeline.Struct() + return PathMgmt{s}, err +} + +func (p PathMgmt_Promise) SegReq() SegReq_Promise { + return SegReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegReply() SegReply_Promise { + return SegReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegReg() SegRecs_Promise { + return SegRecs_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegSync() SegRecs_Promise { + return SegRecs_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SRevInfo() SignedBlob_Promise { + return SignedBlob_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) IfStateReq() IFStateReq_Promise { + return IFStateReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) IfStateInfos() IFStateInfos_Promise { + return IFStateInfos_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegChangesIdReq() SegChangesIdReq_Promise { + return SegChangesIdReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegChangesIdReply() SegChangesIdReply_Promise { + return SegChangesIdReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegChangesReq() SegChangesReq_Promise { + return SegChangesReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) SegChangesReply() SegRecs_Promise { + return SegRecs_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) HpSegReq() HPSegReq_Promise { + return HPSegReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) HpSegReply() HPSegReply_Promise { + return HPSegReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) HpSegReg() HPSegRecs_Promise { + return HPSegRecs_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) HpCfgReq() HPCfgReq_Promise { + return HPCfgReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathMgmt_Promise) HpCfgReply() HPCfgReply_Promise { + return HPCfgReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +const schema_8fcd13516850d142 = "x\xda|V\x7flTY\x15>\xe7\xde\x99\xce\xefv" + + "\xc6\xfb\x8c\xdd\xb8\xb1\xbb\x1bL\xb6H7l\x81\xecn" + + "\x83\xf6\x07%\xcb,\x8b\xf6\xf5%\xeb\xee\xc6U\x87\x99" + + "7\xd3\xa1\xd3\xe9t\xde@S\x89\xa9\x9a\xa81\x8a\x04" + + "D\x03F\x02\x18\x08)\x88\x86&$\xa4\xa4(\x1a\x10" + + "\x1b!\x14\xc1\x10Pc\x11#!\x10\x91\xdf\x14\xea\xdb" + + "\x9c;\xd3\xf7\xa6o\xa6\xfdo\xe6~\xdf;\xe7\xbb\xe7" + + "\x9e\xfb\x9d\xbb4\xe0jc\xaf\xbb\xbf\xef\x06P\xdb\xdc" + + "5\xe6\x8b'[7\x0f\xdcT\xb7\x82\x1aF4;&" + + "\xbbzTqn+\xb8\xd1\x03 F\xd8\x848\xc6\xe8" + + "\xd7Q6\x08h\x8e\x7fQ\x99\x09\x1c\\\xfb\x13\x88\x84" + + "\xcb\xb9\x92\xf12\xff\xbdh\xe4\xf4\xeb\xb3\x9c\xb8'\xae" + + "\xbdqmt\xea\x83\xaa\xdc\x03|B\x1c\x95\xdc#\x92" + + "\xfb\x99\xef\xb9\xbe\xc9V\xe0n\x12\xc1m\xb2\x8b\x18>" + + "\xd7\x98\x88\xc8_!\xd7o\x00\xcd\x89\x0b?\x0fvL" + + "/\xd9\xe7\x10\xbc\x1a=\x11\x00\xf1\x03\xd7\x84\xf8)\xb1" + + "\x97ms\xfd\x96\x03\x9aS\xd7\xbf2z\xf6g\xbd\x07" + + "\x1c2d\xf2\x11\xefEq\xcc+\xb7\xe7\xa5\xd0?<" + + "\xb3\xfc\x97\xeb\x83G\x0e:\xb8\xb2\x14\x1f\xf8\xee\x09\xdd" + + "G\xbfb\xbeV@\xf3\xaf?N\xb6o\x9fy|\xa8" + + "\x1aw\x9b\xef\xaa\xd8-\xb9\xbb$w\xed\xaf\xb7<\xfa" + + "\xc3\xd0\xd3\xc3\xd5J\xf1'\xdf\x98\x98\x94\xdcs>*" + + "\xc5\x8f\x0e]\x0fM=\xda\xc9M\xfb)n\x9bz" + + "\xe6\xc9\xad\xf3\xef\x8dW\x89\xbb\xec\xb4\xff\x13(.K" + + "\xf2\xa4\x0c\xbc\xed\xc2\xbe\xff\xf4No9\xeb\xa8\xb1\xac" + + "+\x06\x18\x8aP@\x1eM\x80\xc8_=\xfc\xb9\x13\x9f" + + "<\xb2\xf6b\x15\xb2h\x0aL\x88\xb7$w\x85\xe4n" + + "\xfat\xe7\xb3u\x8d;\xfe\x01\xea\xa7\x90\xdb\xc7\xaex" + + "\x90J\x1c\xb8\x05(>\x0a\x90\xdc\xf8\x0b\xdf8\xee\x0f" + + "{\xee;\xdbRF\x1d\x0f\x8c\x8a\xd3\x14u\xd9\xa9\xc0" + + "\x97\x11\xd0\xcc\xc5\x0a=_\xebK\xf5\xb1\xc2k\xf1X" + + ".\x9bkY\xd3\xa5\xe9\xa9n}\x00\xa0\x0bQ\xf5r" + + "\x17\x80\x0b\x01\"\x8d\xcd\x00\xea\"\x8e\xeaR\x86\x88\x0a" + + "\xd2Z\xd3;\x00\xea\x12\x8e\xea\x1a\x86\x0d\x09\xa3\x10m" + + "G\x1f0\xf4\x01\x9a\xa9|\xff\xc6\\4a\x00\x00\xd6" + + "\x02vq\xc4\xb0]u@Z\xacL.S\xc7\x0dg" + + "\xea\xc5\xa5\xd4m\x0c#\xb3\xb9?\xdf\x0d\xa0\xae\xe4\xa8" + + "\xbe\xcf\xb0.\xaf\xc7\x0d;M\xdd\x98\x7f\xe5\xe6\xf7v" + + "\xee\x99Mct\xeb\x9b\xa2\xd9d?`\x19\xa9\xfb_" + + "\xd3o|\xf7\xed\xe6=\x0bk\xc9e\x86*\x0a\xf1\x8a" + + "]\x08KM\x13I|\x95\xa3\xba\x9c\xa1'\xaf\x0f`" + + "\xd8>\"@\x0cCIc\xd86\x82\xe2\xb2\x95\x17g" + + "\xf3\xb6\x16\xebOI\x83V\xd2\xd5T\xfd6\x8e\xea\xbb" + + "eI\xa3\xb4\xd8\xc9Q\xedb\x88\x0c\xcbz$\xb2\xae" + + "\x19X\x83\x91\x8f\xdb'2\xf7|\x1a\x92\x99X\xca\xa8" + + "\xdctW\xac\xd0\xb3.\xd5W(n\xba\x93\xbb\x82\xa6" + + "I\x02\xc49l\x06\xd0\xce\"G\xed\x122\x0c\xe1\xff" + + "M)BLb\x0b\x80\xf6g\x02\xae\x10\xc0fL\x05" + + "\x19\x80\xb8\x8c\xef\x00h\x97\x08\xf8'\x01\xfc\xb9\xa9 " + + "\x07\x10\x7f\x97_\\!\xe0\x06\x01\xaeg\xa6\x82.\x00" + + "1\x85\x1d\x00\xda\xdf\x08\xb8I\x80{\xdaT\xd0\x0d " + + "\xfe-C\xdd \xe0.\x015OM\x05k\x00\xc4\x1d" + + "\xfc\x10@\xbbM\xc0\x13\x02\x7f\xb0\xa2\x19\xbc\x96\xac\xa3)J%\x0e\x7f" + + "\xabxy\xe66\xc8\xb7\xe5\xc0\x8b4u\x97\x9eIo" + + "R\x83\xa4\xd7\xe7c\x88\xc0\x90\x9e_\xf1X\xbcG\xff" + + "R6\x038d\xadU\xb4b\x83\xd4N\xb2\xeb-\xd9" + + "\xbb\xe8\xdcvpT\xf7\xda\xcf\xb1\xdd\xb4\xb6\x93\xa3\xba" + + "\xbf\xec:\xef\xa37\xda^\x8e\xea\xaf\x18F8\x16\x15" + + "\x8d\x10s?G\xf5w\x0c#.&\xc7od\x9c\x16" + + "\x8fsT/1\x8c\xb8\xb9\x1c\xbd\x91\xc9\x0f\x01\xd4\x0b" + + "\x1c\xd5\xdb\x0b\xb9\xc1\xf0&=o\xa4\xfb\xb3V\xc5d" + + "'E\xb5N2\xb5R\xf7\x0c\x0f\xe6\xd3\x05=o\xf5" + + "\x80\xafx\x9d\x87\xf3z,Q\xb9l\xe6\xf5T\xda(" + + "\xe4\xd3\xc0u'\xf6q\x00\x00\x00\xff\xff4\x06O\xa2" + +func init() { + schemas.Register(schema_8fcd13516850d142, + 0x8f51e8717b3fbe1c, + 0x934ba70bfd144ebd, + 0x9359e1b2db37dbbb, + 0x9d0135027d04861e, + 0xa12cfa420c9ad0ca, + 0xa56b96c8b25ce2e1, + 0xa7ad0c62a234c68b, + 0xaaf7fd9241668ed6, + 0xabf979c3f68dae4b, + 0xb27bf6e10de2aa8c, + 0xba21c7133ee44518, + 0xbd56ceeaf8c65140, + 0xc88dfa6be7a1d091, + 0xd24bad15bb2bab5e, + 0xde94294dfb441b76, + 0xf307100ab87a1963) +} diff --git a/go/proto/path_seg.capnp.go b/go/proto/path_seg.capnp.go new file mode 100644 index 0000000000..cd2aae0aa9 --- /dev/null +++ b/go/proto/path_seg.capnp.go @@ -0,0 +1,771 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type PathSegment struct{ capnp.Struct } + +// PathSegment_TypeID is the unique identifier for the type PathSegment. +const PathSegment_TypeID = 0x939cc09a86ba70fa + +func NewPathSegment(s *capnp.Segment) (PathSegment, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return PathSegment{st}, err +} + +func NewRootPathSegment(s *capnp.Segment) (PathSegment, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return PathSegment{st}, err +} + +func ReadRootPathSegment(msg *capnp.Message) (PathSegment, error) { + root, err := msg.RootPtr() + return PathSegment{root.Struct()}, err +} + +func (s PathSegment) String() string { + str, _ := text.Marshal(0x939cc09a86ba70fa, s.Struct) + return str +} + +func (s PathSegment) Sdata() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s PathSegment) HasSdata() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathSegment) SetSdata(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s PathSegment) AsEntries() (SignedBlob_List, error) { + p, err := s.Struct.Ptr(1) + return SignedBlob_List{List: p.List()}, err +} + +func (s PathSegment) HasAsEntries() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s PathSegment) SetAsEntries(v SignedBlob_List) error { + return s.Struct.SetPtr(1, v.List.ToPtr()) +} + +// NewAsEntries sets the asEntries field to a newly +// allocated SignedBlob_List, preferring placement in s's segment. +func (s PathSegment) NewAsEntries(n int32) (SignedBlob_List, error) { + l, err := NewSignedBlob_List(s.Struct.Segment(), n) + if err != nil { + return SignedBlob_List{}, err + } + err = s.Struct.SetPtr(1, l.List.ToPtr()) + return l, err +} + +// PathSegment_List is a list of PathSegment. +type PathSegment_List struct{ capnp.List } + +// NewPathSegment creates a new list of PathSegment. +func NewPathSegment_List(s *capnp.Segment, sz int32) (PathSegment_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return PathSegment_List{l}, err +} + +func (s PathSegment_List) At(i int) PathSegment { return PathSegment{s.List.Struct(i)} } + +func (s PathSegment_List) Set(i int, v PathSegment) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathSegment_List) String() string { + str, _ := text.MarshalList(0x939cc09a86ba70fa, s.List) + return str +} + +// PathSegment_Promise is a wrapper for a PathSegment promised by a client call. +type PathSegment_Promise struct{ *capnp.Pipeline } + +func (p PathSegment_Promise) Struct() (PathSegment, error) { + s, err := p.Pipeline.Struct() + return PathSegment{s}, err +} + +type PathSegmentSignedData struct{ capnp.Struct } + +// PathSegmentSignedData_TypeID is the unique identifier for the type PathSegmentSignedData. +const PathSegmentSignedData_TypeID = 0xc7cf7a18177aec2a + +func NewPathSegmentSignedData(s *capnp.Segment) (PathSegmentSignedData, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return PathSegmentSignedData{st}, err +} + +func NewRootPathSegmentSignedData(s *capnp.Segment) (PathSegmentSignedData, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return PathSegmentSignedData{st}, err +} + +func ReadRootPathSegmentSignedData(msg *capnp.Message) (PathSegmentSignedData, error) { + root, err := msg.RootPtr() + return PathSegmentSignedData{root.Struct()}, err +} + +func (s PathSegmentSignedData) String() string { + str, _ := text.Marshal(0xc7cf7a18177aec2a, s.Struct) + return str +} + +func (s PathSegmentSignedData) InfoF() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s PathSegmentSignedData) HasInfoF() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathSegmentSignedData) SetInfoF(v []byte) error { + return s.Struct.SetData(0, v) +} + +// PathSegmentSignedData_List is a list of PathSegmentSignedData. +type PathSegmentSignedData_List struct{ capnp.List } + +// NewPathSegmentSignedData creates a new list of PathSegmentSignedData. +func NewPathSegmentSignedData_List(s *capnp.Segment, sz int32) (PathSegmentSignedData_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return PathSegmentSignedData_List{l}, err +} + +func (s PathSegmentSignedData_List) At(i int) PathSegmentSignedData { + return PathSegmentSignedData{s.List.Struct(i)} +} + +func (s PathSegmentSignedData_List) Set(i int, v PathSegmentSignedData) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s PathSegmentSignedData_List) String() string { + str, _ := text.MarshalList(0xc7cf7a18177aec2a, s.List) + return str +} + +// PathSegmentSignedData_Promise is a wrapper for a PathSegmentSignedData promised by a client call. +type PathSegmentSignedData_Promise struct{ *capnp.Pipeline } + +func (p PathSegmentSignedData_Promise) Struct() (PathSegmentSignedData, error) { + s, err := p.Pipeline.Struct() + return PathSegmentSignedData{s}, err +} + +type ASEntry struct{ capnp.Struct } +type ASEntry_exts ASEntry + +// ASEntry_TypeID is the unique identifier for the type ASEntry. +const ASEntry_TypeID = 0xd4a209e8e78874ff + +func NewASEntry(s *capnp.Segment) (ASEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 32, PointerCount: 3}) + return ASEntry{st}, err +} + +func NewRootASEntry(s *capnp.Segment) (ASEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 32, PointerCount: 3}) + return ASEntry{st}, err +} + +func ReadRootASEntry(msg *capnp.Message) (ASEntry, error) { + root, err := msg.RootPtr() + return ASEntry{root.Struct()}, err +} + +func (s ASEntry) String() string { + str, _ := text.Marshal(0xd4a209e8e78874ff, s.Struct) + return str +} + +func (s ASEntry) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s ASEntry) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s ASEntry) TrcVer() uint64 { + return s.Struct.Uint64(8) +} + +func (s ASEntry) SetTrcVer(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s ASEntry) CertVer() uint64 { + return s.Struct.Uint64(16) +} + +func (s ASEntry) SetCertVer(v uint64) { + s.Struct.SetUint64(16, v) +} + +func (s ASEntry) IfIDSize() uint8 { + return s.Struct.Uint8(24) +} + +func (s ASEntry) SetIfIDSize(v uint8) { + s.Struct.SetUint8(24, v) +} + +func (s ASEntry) Hops() (HopEntry_List, error) { + p, err := s.Struct.Ptr(0) + return HopEntry_List{List: p.List()}, err +} + +func (s ASEntry) HasHops() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s ASEntry) SetHops(v HopEntry_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewHops sets the hops field to a newly +// allocated HopEntry_List, preferring placement in s's segment. +func (s ASEntry) NewHops(n int32) (HopEntry_List, error) { + l, err := NewHopEntry_List(s.Struct.Segment(), n) + if err != nil { + return HopEntry_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +func (s ASEntry) Mtu() uint16 { + return s.Struct.Uint16(26) +} + +func (s ASEntry) SetMtu(v uint16) { + s.Struct.SetUint16(26, v) +} + +func (s ASEntry) Exts() ASEntry_exts { return ASEntry_exts(s) } + +func (s ASEntry_exts) RoutingPolicy() (RoutingPolicyExt, error) { + p, err := s.Struct.Ptr(1) + return RoutingPolicyExt{Struct: p.Struct()}, err +} + +func (s ASEntry_exts) HasRoutingPolicy() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s ASEntry_exts) SetRoutingPolicy(v RoutingPolicyExt) error { + return s.Struct.SetPtr(1, v.Struct.ToPtr()) +} + +// NewRoutingPolicy sets the routingPolicy field to a newly +// allocated RoutingPolicyExt struct, preferring placement in s's segment. +func (s ASEntry_exts) NewRoutingPolicy() (RoutingPolicyExt, error) { + ss, err := NewRoutingPolicyExt(s.Struct.Segment()) + if err != nil { + return RoutingPolicyExt{}, err + } + err = s.Struct.SetPtr(1, ss.Struct.ToPtr()) + return ss, err +} + +func (s ASEntry_exts) Sibra() (SibraPCBExt, error) { + p, err := s.Struct.Ptr(2) + return SibraPCBExt{Struct: p.Struct()}, err +} + +func (s ASEntry_exts) HasSibra() bool { + p, err := s.Struct.Ptr(2) + return p.IsValid() || err != nil +} + +func (s ASEntry_exts) SetSibra(v SibraPCBExt) error { + return s.Struct.SetPtr(2, v.Struct.ToPtr()) +} + +// NewSibra sets the sibra field to a newly +// allocated SibraPCBExt struct, preferring placement in s's segment. +func (s ASEntry_exts) NewSibra() (SibraPCBExt, error) { + ss, err := NewSibraPCBExt(s.Struct.Segment()) + if err != nil { + return SibraPCBExt{}, err + } + err = s.Struct.SetPtr(2, ss.Struct.ToPtr()) + return ss, err +} + +// ASEntry_List is a list of ASEntry. +type ASEntry_List struct{ capnp.List } + +// NewASEntry creates a new list of ASEntry. +func NewASEntry_List(s *capnp.Segment, sz int32) (ASEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 32, PointerCount: 3}, sz) + return ASEntry_List{l}, err +} + +func (s ASEntry_List) At(i int) ASEntry { return ASEntry{s.List.Struct(i)} } + +func (s ASEntry_List) Set(i int, v ASEntry) error { return s.List.SetStruct(i, v.Struct) } + +func (s ASEntry_List) String() string { + str, _ := text.MarshalList(0xd4a209e8e78874ff, s.List) + return str +} + +// ASEntry_Promise is a wrapper for a ASEntry promised by a client call. +type ASEntry_Promise struct{ *capnp.Pipeline } + +func (p ASEntry_Promise) Struct() (ASEntry, error) { + s, err := p.Pipeline.Struct() + return ASEntry{s}, err +} + +func (p ASEntry_Promise) Exts() ASEntry_exts_Promise { return ASEntry_exts_Promise{p.Pipeline} } + +// ASEntry_exts_Promise is a wrapper for a ASEntry_exts promised by a client call. +type ASEntry_exts_Promise struct{ *capnp.Pipeline } + +func (p ASEntry_exts_Promise) Struct() (ASEntry_exts, error) { + s, err := p.Pipeline.Struct() + return ASEntry_exts{s}, err +} + +func (p ASEntry_exts_Promise) RoutingPolicy() RoutingPolicyExt_Promise { + return RoutingPolicyExt_Promise{Pipeline: p.Pipeline.GetPipeline(1)} +} + +func (p ASEntry_exts_Promise) Sibra() SibraPCBExt_Promise { + return SibraPCBExt_Promise{Pipeline: p.Pipeline.GetPipeline(2)} +} + +type HopEntry struct{ capnp.Struct } + +// HopEntry_TypeID is the unique identifier for the type HopEntry. +const HopEntry_TypeID = 0x8bb1ddafb4872b0b + +func NewHopEntry(s *capnp.Segment) (HopEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 40, PointerCount: 1}) + return HopEntry{st}, err +} + +func NewRootHopEntry(s *capnp.Segment) (HopEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 40, PointerCount: 1}) + return HopEntry{st}, err +} + +func ReadRootHopEntry(msg *capnp.Message) (HopEntry, error) { + root, err := msg.RootPtr() + return HopEntry{root.Struct()}, err +} + +func (s HopEntry) String() string { + str, _ := text.Marshal(0x8bb1ddafb4872b0b, s.Struct) + return str +} + +func (s HopEntry) InIA() uint64 { + return s.Struct.Uint64(0) +} + +func (s HopEntry) SetInIA(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s HopEntry) RemoteInIF() uint64 { + return s.Struct.Uint64(8) +} + +func (s HopEntry) SetRemoteInIF(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s HopEntry) InMTU() uint16 { + return s.Struct.Uint16(16) +} + +func (s HopEntry) SetInMTU(v uint16) { + s.Struct.SetUint16(16, v) +} + +func (s HopEntry) OutIA() uint64 { + return s.Struct.Uint64(24) +} + +func (s HopEntry) SetOutIA(v uint64) { + s.Struct.SetUint64(24, v) +} + +func (s HopEntry) RemoteOutIF() uint64 { + return s.Struct.Uint64(32) +} + +func (s HopEntry) SetRemoteOutIF(v uint64) { + s.Struct.SetUint64(32, v) +} + +func (s HopEntry) HopF() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s HopEntry) HasHopF() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HopEntry) SetHopF(v []byte) error { + return s.Struct.SetData(0, v) +} + +// HopEntry_List is a list of HopEntry. +type HopEntry_List struct{ capnp.List } + +// NewHopEntry creates a new list of HopEntry. +func NewHopEntry_List(s *capnp.Segment, sz int32) (HopEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 40, PointerCount: 1}, sz) + return HopEntry_List{l}, err +} + +func (s HopEntry_List) At(i int) HopEntry { return HopEntry{s.List.Struct(i)} } + +func (s HopEntry_List) Set(i int, v HopEntry) error { return s.List.SetStruct(i, v.Struct) } + +func (s HopEntry_List) String() string { + str, _ := text.MarshalList(0x8bb1ddafb4872b0b, s.List) + return str +} + +// HopEntry_Promise is a wrapper for a HopEntry promised by a client call. +type HopEntry_Promise struct{ *capnp.Pipeline } + +func (p HopEntry_Promise) Struct() (HopEntry, error) { + s, err := p.Pipeline.Struct() + return HopEntry{s}, err +} + +type PCB struct{ capnp.Struct } + +// PCB_TypeID is the unique identifier for the type PCB. +const PCB_TypeID = 0xd6c04763377951e5 + +func NewPCB(s *capnp.Segment) (PCB, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PCB{st}, err +} + +func NewRootPCB(s *capnp.Segment) (PCB, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PCB{st}, err +} + +func ReadRootPCB(msg *capnp.Message) (PCB, error) { + root, err := msg.RootPtr() + return PCB{root.Struct()}, err +} + +func (s PCB) String() string { + str, _ := text.Marshal(0xd6c04763377951e5, s.Struct) + return str +} + +func (s PCB) PathSeg() (PathSegment, error) { + p, err := s.Struct.Ptr(0) + return PathSegment{Struct: p.Struct()}, err +} + +func (s PCB) HasPathSeg() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PCB) SetPathSeg(v PathSegment) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPathSeg sets the pathSeg field to a newly +// allocated PathSegment struct, preferring placement in s's segment. +func (s PCB) NewPathSeg() (PathSegment, error) { + ss, err := NewPathSegment(s.Struct.Segment()) + if err != nil { + return PathSegment{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PCB) IfID() uint64 { + return s.Struct.Uint64(0) +} + +func (s PCB) SetIfID(v uint64) { + s.Struct.SetUint64(0, v) +} + +// PCB_List is a list of PCB. +type PCB_List struct{ capnp.List } + +// NewPCB creates a new list of PCB. +func NewPCB_List(s *capnp.Segment, sz int32) (PCB_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return PCB_List{l}, err +} + +func (s PCB_List) At(i int) PCB { return PCB{s.List.Struct(i)} } + +func (s PCB_List) Set(i int, v PCB) error { return s.List.SetStruct(i, v.Struct) } + +func (s PCB_List) String() string { + str, _ := text.MarshalList(0xd6c04763377951e5, s.List) + return str +} + +// PCB_Promise is a wrapper for a PCB promised by a client call. +type PCB_Promise struct{ *capnp.Pipeline } + +func (p PCB_Promise) Struct() (PCB, error) { + s, err := p.Pipeline.Struct() + return PCB{s}, err +} + +func (p PCB_Promise) PathSeg() PathSegment_Promise { + return PathSegment_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type PathSegMeta struct{ capnp.Struct } + +// PathSegMeta_TypeID is the unique identifier for the type PathSegMeta. +const PathSegMeta_TypeID = 0x9f98567b3c0aba0f + +func NewPathSegMeta(s *capnp.Segment) (PathSegMeta, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PathSegMeta{st}, err +} + +func NewRootPathSegMeta(s *capnp.Segment) (PathSegMeta, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PathSegMeta{st}, err +} + +func ReadRootPathSegMeta(msg *capnp.Message) (PathSegMeta, error) { + root, err := msg.RootPtr() + return PathSegMeta{root.Struct()}, err +} + +func (s PathSegMeta) String() string { + str, _ := text.Marshal(0x9f98567b3c0aba0f, s.Struct) + return str +} + +func (s PathSegMeta) PathSeg() (PathSegment, error) { + p, err := s.Struct.Ptr(0) + return PathSegment{Struct: p.Struct()}, err +} + +func (s PathSegMeta) HasPathSeg() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathSegMeta) SetPathSeg(v PathSegment) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPathSeg sets the pathSeg field to a newly +// allocated PathSegment struct, preferring placement in s's segment. +func (s PathSegMeta) NewPathSeg() (PathSegment, error) { + ss, err := NewPathSegment(s.Struct.Segment()) + if err != nil { + return PathSegment{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathSegMeta) Type() PathSegType { + return PathSegType(s.Struct.Uint16(0)) +} + +func (s PathSegMeta) SetType(v PathSegType) { + s.Struct.SetUint16(0, uint16(v)) +} + +// PathSegMeta_List is a list of PathSegMeta. +type PathSegMeta_List struct{ capnp.List } + +// NewPathSegMeta creates a new list of PathSegMeta. +func NewPathSegMeta_List(s *capnp.Segment, sz int32) (PathSegMeta_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return PathSegMeta_List{l}, err +} + +func (s PathSegMeta_List) At(i int) PathSegMeta { return PathSegMeta{s.List.Struct(i)} } + +func (s PathSegMeta_List) Set(i int, v PathSegMeta) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathSegMeta_List) String() string { + str, _ := text.MarshalList(0x9f98567b3c0aba0f, s.List) + return str +} + +// PathSegMeta_Promise is a wrapper for a PathSegMeta promised by a client call. +type PathSegMeta_Promise struct{ *capnp.Pipeline } + +func (p PathSegMeta_Promise) Struct() (PathSegMeta, error) { + s, err := p.Pipeline.Struct() + return PathSegMeta{s}, err +} + +func (p PathSegMeta_Promise) PathSeg() PathSegment_Promise { + return PathSegment_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type PathSegType uint16 + +// PathSegType_TypeID is the unique identifier for the type PathSegType. +const PathSegType_TypeID = 0xa1f7a9650aa23880 + +// Values of PathSegType. +const ( + PathSegType_unset PathSegType = 0 + PathSegType_up PathSegType = 1 + PathSegType_down PathSegType = 2 + PathSegType_core PathSegType = 3 +) + +// String returns the enum's constant name. +func (c PathSegType) String() string { + switch c { + case PathSegType_unset: + return "unset" + case PathSegType_up: + return "up" + case PathSegType_down: + return "down" + case PathSegType_core: + return "core" + + default: + return "" + } +} + +// PathSegTypeFromString returns the enum value with a name, +// or the zero value if there's no such value. +func PathSegTypeFromString(c string) PathSegType { + switch c { + case "unset": + return PathSegType_unset + case "up": + return PathSegType_up + case "down": + return PathSegType_down + case "core": + return PathSegType_core + + default: + return 0 + } +} + +type PathSegType_List struct{ capnp.List } + +func NewPathSegType_List(s *capnp.Segment, sz int32) (PathSegType_List, error) { + l, err := capnp.NewUInt16List(s, sz) + return PathSegType_List{l.List}, err +} + +func (l PathSegType_List) At(i int) PathSegType { + ul := capnp.UInt16List{List: l.List} + return PathSegType(ul.At(i)) +} + +func (l PathSegType_List) Set(i int, v PathSegType) { + ul := capnp.UInt16List{List: l.List} + ul.Set(i, uint16(v)) +} + +const schema_fb8053d9fb34b837 = "x\xda\xacT_h\x1c\xd5\x1b\xfd\xce\xbd3\xbbI~" + + "\xeco\xf62+MEY+\x0a\xbaji\xd3Jb" + + "Qbjm\xbbBpo\xb7V\xf4E\xa7\x9b\xdb\xcd" + + "\x80\x99\x1dv\xee\xd2nD\xda\x97\xf8\x07\x11\x1f\x14\xd1" + + "\xd2\x92\xb6(\x18h\xb0B\x0b\xdb`!)\x95\"\x08" + + "\xbe\x88h\xa0\xe0\x9f\x8a\x06|\x17[t\xe4\xeef\xff" + + "\x90\xb4o\xbe\xdd\xf9\xf8\xee9\xdf\xf9\xee9\xb3e\x05" + + "O\xb2\xad\xf6UF$\xef\xb1\x13\xf1\xff\x1ez\xe3\xfc" + + "g\xd7>\x7f\x9b\xa4\x03;\x1enl\xbf\xf9C\xf1\xd8" + + "M\xb2\x91$r\xf3\xb8\xecJs\xda6\x8e\xe7A\x88" + + "o\x84\x0b\xaf\x1f_<\xf1\x1e\x09\x07=\xcd\xcc4\x9f" + + "f\xcb\xee|\xf34\xc7\x0e\x13bga\xe0\xf1W\x0f" + + "|8k\x90\xb1\x16y#_v\xef\xe7\xe6\xb4\x89\x9b" + + "\xe6c#g\x06\xd4\xdc\x9f\xa7I8\xac\xdbKp_" + + "\xe3\xcb\xee[\xcd\xc6\x19^&\xc4\xf1\xec\xcc\xc9\x7f\x06" + + "\xf4e\x92\x1b`\xc5\xb1~\xf3\xb7\xdf\xfb\xcf|Kw" + + "\xf0$\x0c3\xff\x99\xe0\xce7!s\x7fLo\x18\x9c" + + "\xfe\xe6\xea\x9aY\x9brRV\x0e\xee\xddVs\x12k" + + "\xd4\xc0\xb6\x81\xa4\x03\xab\xa7\xbb\xc9\xfc\x98\xb5\xe0\x8e\x99" + + "\xe6mOX\xef\x9a5\xfc*\xeb\xc3\xa5=\x8b\xdf\xdd" + + "R\xda%\xfb\xb8\xfb\xa5mNK\xb6\x99#\xf4\xf4\xe4" + + "K\x91*\xb3\xcd%/\x0c\xc2\x1d{+\xe1\xd3\x81\xae" + + "\xd6\xa9\x00\xc8An\x11Y \x12\x1f\xe5\x88\xe4\xfb\x1c" + + "\xf2\x14\x83\x0020\xc5\x93/\x12\xc9\x13\x1c\xf2S\x06" + + "\xc1\xfa2`D\xe2\x93!\"y\x8aC\x9ee\x10\x9c" + + "g\xc0\x89\xc4\x9c)~\xcc!\xcf1\x08\xcb\xca\xc0\"" + + "\x12\xf3\x07\x89\xe4Y\x0e\xd9`\x80\x9d\x81M$.\x18" + + "\x9es\x1c\xf2\x0b\x06\xc7\x0f\xf2c\xe8'\x86~B\\" + + "US\x15\xad\xf2\x01\xf1\xfc\xeev1\xeb\x07\xe3\xfb\x9f" + + "C\x92\x18\x92\x84l\xa5\xa6\xd7]x\xb6FI\xdd\xbd" + + "\xe1LV\xc2\xddH\x11C\xea\x16\xe2\x0b\x9e\x9e,\xaa" + + "\xf2\x94\xe2\x816\xfa\xfb:\xfa\x1f4\x02\xee\xe3\x90[" + + "z\xf4?\xb2\x8fH>\xcc!\xf72d\xa3\x09O{" + + "\x1dd/2[\xf4\x15!\xc2\xff\x09\x05\x0e\xa4\xe3}" + + "\xbf\xdc\x18\x9e\xd934K\x04S\xbc\x1d\xfd\xb8\xe2\xda" + + "[C\xbf\xb3K\xdfa7\xabz\x80Cng8\x1a" + + "\xb6\xae\"\xdd\x0d\x01\x01i\x82\xa3\xeb\xa1\x82\xd3\xb50" + + "\x01\xce\xed\xb9\xf7\xd7y\xa8\x0cw\xba\xf9\x98F6 " + + "6\xddI\x04&6\xe6\x88\xc0\x85\xc8\x11ekA\xa4" + + "4\xaf\x85\xceD\xe5p\xe0\x94*U\xb5\x0er\xac\xd8" + + "t\xd2f\x95<\xa2##&\x8d\x0c\x12\x06\xb5\xda\x9d" + + "\\\x80e\x8c1\xc5\xd6\xa1\xd5e\x8e0\xc4\xd5JM" + + "\xfbA\xb9@\xd9\xca+~\xa9\x8et\xfc\xd7\xf5GG" + + "\x1a\xcbK\x1f\xac\xca\xcaF\xfe\xc1\xaa\x87t\xfc\xce\xcb" + + "+/\\\\\xf9\xbb\xb1Z\xef\x0c\xc1\xd7>i\xa0\x8b" + + "~9P\x13\xce.\xaf\xb5]\xab\xb3\xdd\x94\xa1\xee\xe3" + + "\x90\x19f,u\xa8\xb2\xde!hk\x1am\x892\x00" + + "wu\x00.\x0cu]\xdbq\xc7\xc5\x1dD\xf2<\x87" + + "\\4\xe9`\xadt\\2\x0f\xd9\xe0\x90WL:\x06" + + "[\xe9Xz\x86H.r\xc8\xaf\x19\xb0\x1a\x8e\xaf\xcc" + + "\xeb^\xe1\x90?2\x08;\xd5J\xc7\xb5{\x89\xe4\xf7" + + "\x1c\xf2:\x03\x12\xe8\xf9\xdf\x88\x9fr\xc4\xb2~4\xe1" + + "Em\xab\x8f\xeaj\xe9\x80\xaa\xb6?\x8f\x96TU\xf7" + + "|\xc7\xfe\xa1\xfc\xae\xa2?\xad\x88\x08\x09bH\xb4\xd2" + + "\xd1\xe3\xd7\xce\xdf\xb7\xe5\xd7\xe4\x94\xae\xb5\xb3\xe6\xa8#" + + ":Z\xb7\x9d\x02\x7fj\xe7\x7ff\\3_{\xd8\x7f" + + "\x03\x00\x00\xff\xff5\xca}\xde" + +func init() { + schemas.Register(schema_fb8053d9fb34b837, + 0x8bb1ddafb4872b0b, + 0x939cc09a86ba70fa, + 0x9f98567b3c0aba0f, + 0xa1f7a9650aa23880, + 0xc2740afe9d859fff, + 0xc7cf7a18177aec2a, + 0xd4a209e8e78874ff, + 0xd6c04763377951e5) +} diff --git a/go/proto/rev_info.capnp.go b/go/proto/rev_info.capnp.go new file mode 100644 index 0000000000..6438efd493 --- /dev/null +++ b/go/proto/rev_info.capnp.go @@ -0,0 +1,123 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type RevInfo struct{ capnp.Struct } + +// RevInfo_TypeID is the unique identifier for the type RevInfo. +const RevInfo_TypeID = 0xe40561cf10a34bc8 + +func NewRevInfo(s *capnp.Segment) (RevInfo, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 32, PointerCount: 0}) + return RevInfo{st}, err +} + +func NewRootRevInfo(s *capnp.Segment) (RevInfo, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 32, PointerCount: 0}) + return RevInfo{st}, err +} + +func ReadRootRevInfo(msg *capnp.Message) (RevInfo, error) { + root, err := msg.RootPtr() + return RevInfo{root.Struct()}, err +} + +func (s RevInfo) String() string { + str, _ := text.Marshal(0xe40561cf10a34bc8, s.Struct) + return str +} + +func (s RevInfo) IfID() uint64 { + return s.Struct.Uint64(0) +} + +func (s RevInfo) SetIfID(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s RevInfo) Isdas() uint64 { + return s.Struct.Uint64(8) +} + +func (s RevInfo) SetIsdas(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s RevInfo) LinkType() LinkType { + return LinkType(s.Struct.Uint16(16)) +} + +func (s RevInfo) SetLinkType(v LinkType) { + s.Struct.SetUint16(16, uint16(v)) +} + +func (s RevInfo) Timestamp() uint32 { + return s.Struct.Uint32(20) +} + +func (s RevInfo) SetTimestamp(v uint32) { + s.Struct.SetUint32(20, v) +} + +func (s RevInfo) Ttl() uint32 { + return s.Struct.Uint32(24) +} + +func (s RevInfo) SetTtl(v uint32) { + s.Struct.SetUint32(24, v) +} + +// RevInfo_List is a list of RevInfo. +type RevInfo_List struct{ capnp.List } + +// NewRevInfo creates a new list of RevInfo. +func NewRevInfo_List(s *capnp.Segment, sz int32) (RevInfo_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 32, PointerCount: 0}, sz) + return RevInfo_List{l}, err +} + +func (s RevInfo_List) At(i int) RevInfo { return RevInfo{s.List.Struct(i)} } + +func (s RevInfo_List) Set(i int, v RevInfo) error { return s.List.SetStruct(i, v.Struct) } + +func (s RevInfo_List) String() string { + str, _ := text.MarshalList(0xe40561cf10a34bc8, s.List) + return str +} + +// RevInfo_Promise is a wrapper for a RevInfo promised by a client call. +type RevInfo_Promise struct{ *capnp.Pipeline } + +func (p RevInfo_Promise) Struct() (RevInfo, error) { + s, err := p.Pipeline.Struct() + return RevInfo{s}, err +} + +const schema_c434abcc856ab808 = "x\xda4\xc81K\xc3@\x1c\x86\xf1\xf7\xbd\xbb4\xe9" + + "\x94\x1e\xc4\xc1A\x0a\x8e\x0e\x82\xe2\xe4\xa2\x83Ku\xf1" + + "_\xdcK\xb0\x09D\xd34\x98P\x14t\x10Zp\xa8" + + "P\x07\xa1\xa0\x9b\xa3_@tup\x10\xfc\x12~\x04" + + "\xf7\x93\x0e\xdd\x9e\xe7\xd7\x8a\xf7\x95\xf5z\x80\x18\xaf\xe1" + + "\xbe\x8e^Z?\xb1\xf7\x0b\x09i\\\xf0v6\xf9~" + + "\xdd\xf9\x84\xf1\x01\xbb\xf2n\xd7|`k\xb5M\xd0]" + + "$\xa3^V\xa4Cn\x9e\xc6eQ\xeev\xf7\x92Q" + + "\xa7H\x87\xc7\xa4D\xda\x00\x86\x80\xbd\xd9\x00\xe4RS" + + "\xc6\x8a\x96\x8c\xb8\xc0\xdbm@\xae5\xe5N\xd1\xaa " + + "\xa2\x02\xec\xe4\x10\x90\xb1\xa6\xcc\x14\xad\xf6\"j\xc0\xde" + + "w\x01\x99j\xca\\\xd1\x9aFD\x03\xd8\xc7u@f" + + "\x9a\xf2\xac\x18fi\xe7\x80M(6\xc1vV\xf5\xe3" + + "jy.\xcf\x8a\xf3\x93\xab2\x01\xc0\xd0\xf5?\x9e\xa6" + + "\x7f\xf3\xfc\x01 C\xd0\xd5\xd9 \xa9\xeax\x00\x96\x0c" + + "\xa0\x18\x80~]\xe7\xcb\xfe\x0f\x00\x00\xff\xff s9" + + "\xea" + +func init() { + schemas.Register(schema_c434abcc856ab808, + 0xe40561cf10a34bc8) +} diff --git a/go/proto/sciond.capnp.go b/go/proto/sciond.capnp.go new file mode 100644 index 0000000000..3c18142e3c --- /dev/null +++ b/go/proto/sciond.capnp.go @@ -0,0 +1,2400 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + strconv "strconv" + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SCIONDMsg struct{ capnp.Struct } +type SCIONDMsg_Which uint16 + +const ( + SCIONDMsg_Which_unset SCIONDMsg_Which = 0 + SCIONDMsg_Which_pathReq SCIONDMsg_Which = 1 + SCIONDMsg_Which_pathReply SCIONDMsg_Which = 2 + SCIONDMsg_Which_asInfoReq SCIONDMsg_Which = 3 + SCIONDMsg_Which_asInfoReply SCIONDMsg_Which = 4 + SCIONDMsg_Which_revNotification SCIONDMsg_Which = 5 + SCIONDMsg_Which_ifInfoRequest SCIONDMsg_Which = 6 + SCIONDMsg_Which_ifInfoReply SCIONDMsg_Which = 7 + SCIONDMsg_Which_serviceInfoRequest SCIONDMsg_Which = 8 + SCIONDMsg_Which_serviceInfoReply SCIONDMsg_Which = 9 + SCIONDMsg_Which_revReply SCIONDMsg_Which = 10 + SCIONDMsg_Which_segTypeHopReq SCIONDMsg_Which = 11 + SCIONDMsg_Which_segTypeHopReply SCIONDMsg_Which = 12 +) + +func (w SCIONDMsg_Which) String() string { + const s = "unsetpathReqpathReplyasInfoReqasInfoReplyrevNotificationifInfoRequestifInfoReplyserviceInfoRequestserviceInfoReplyrevReplysegTypeHopReqsegTypeHopReply" + switch w { + case SCIONDMsg_Which_unset: + return s[0:5] + case SCIONDMsg_Which_pathReq: + return s[5:12] + case SCIONDMsg_Which_pathReply: + return s[12:21] + case SCIONDMsg_Which_asInfoReq: + return s[21:30] + case SCIONDMsg_Which_asInfoReply: + return s[30:41] + case SCIONDMsg_Which_revNotification: + return s[41:56] + case SCIONDMsg_Which_ifInfoRequest: + return s[56:69] + case SCIONDMsg_Which_ifInfoReply: + return s[69:80] + case SCIONDMsg_Which_serviceInfoRequest: + return s[80:98] + case SCIONDMsg_Which_serviceInfoReply: + return s[98:114] + case SCIONDMsg_Which_revReply: + return s[114:122] + case SCIONDMsg_Which_segTypeHopReq: + return s[122:135] + case SCIONDMsg_Which_segTypeHopReply: + return s[135:150] + + } + return "SCIONDMsg_Which(" + strconv.FormatUint(uint64(w), 10) + ")" +} + +// SCIONDMsg_TypeID is the unique identifier for the type SCIONDMsg. +const SCIONDMsg_TypeID = 0x91ea9bb47f46c346 + +func NewSCIONDMsg(s *capnp.Segment) (SCIONDMsg, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return SCIONDMsg{st}, err +} + +func NewRootSCIONDMsg(s *capnp.Segment) (SCIONDMsg, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return SCIONDMsg{st}, err +} + +func ReadRootSCIONDMsg(msg *capnp.Message) (SCIONDMsg, error) { + root, err := msg.RootPtr() + return SCIONDMsg{root.Struct()}, err +} + +func (s SCIONDMsg) String() string { + str, _ := text.Marshal(0x91ea9bb47f46c346, s.Struct) + return str +} + +func (s SCIONDMsg) Which() SCIONDMsg_Which { + return SCIONDMsg_Which(s.Struct.Uint16(8)) +} +func (s SCIONDMsg) Id() uint64 { + return s.Struct.Uint64(0) +} + +func (s SCIONDMsg) SetId(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s SCIONDMsg) SetUnset() { + s.Struct.SetUint16(8, 0) + +} + +func (s SCIONDMsg) PathReq() (PathReq, error) { + if s.Struct.Uint16(8) != 1 { + panic("Which() != pathReq") + } + p, err := s.Struct.Ptr(0) + return PathReq{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasPathReq() bool { + if s.Struct.Uint16(8) != 1 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetPathReq(v PathReq) error { + s.Struct.SetUint16(8, 1) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPathReq sets the pathReq field to a newly +// allocated PathReq struct, preferring placement in s's segment. +func (s SCIONDMsg) NewPathReq() (PathReq, error) { + s.Struct.SetUint16(8, 1) + ss, err := NewPathReq(s.Struct.Segment()) + if err != nil { + return PathReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) PathReply() (PathReply, error) { + if s.Struct.Uint16(8) != 2 { + panic("Which() != pathReply") + } + p, err := s.Struct.Ptr(0) + return PathReply{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasPathReply() bool { + if s.Struct.Uint16(8) != 2 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetPathReply(v PathReply) error { + s.Struct.SetUint16(8, 2) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPathReply sets the pathReply field to a newly +// allocated PathReply struct, preferring placement in s's segment. +func (s SCIONDMsg) NewPathReply() (PathReply, error) { + s.Struct.SetUint16(8, 2) + ss, err := NewPathReply(s.Struct.Segment()) + if err != nil { + return PathReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) AsInfoReq() (ASInfoReq, error) { + if s.Struct.Uint16(8) != 3 { + panic("Which() != asInfoReq") + } + p, err := s.Struct.Ptr(0) + return ASInfoReq{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasAsInfoReq() bool { + if s.Struct.Uint16(8) != 3 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetAsInfoReq(v ASInfoReq) error { + s.Struct.SetUint16(8, 3) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewAsInfoReq sets the asInfoReq field to a newly +// allocated ASInfoReq struct, preferring placement in s's segment. +func (s SCIONDMsg) NewAsInfoReq() (ASInfoReq, error) { + s.Struct.SetUint16(8, 3) + ss, err := NewASInfoReq(s.Struct.Segment()) + if err != nil { + return ASInfoReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) AsInfoReply() (ASInfoReply, error) { + if s.Struct.Uint16(8) != 4 { + panic("Which() != asInfoReply") + } + p, err := s.Struct.Ptr(0) + return ASInfoReply{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasAsInfoReply() bool { + if s.Struct.Uint16(8) != 4 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetAsInfoReply(v ASInfoReply) error { + s.Struct.SetUint16(8, 4) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewAsInfoReply sets the asInfoReply field to a newly +// allocated ASInfoReply struct, preferring placement in s's segment. +func (s SCIONDMsg) NewAsInfoReply() (ASInfoReply, error) { + s.Struct.SetUint16(8, 4) + ss, err := NewASInfoReply(s.Struct.Segment()) + if err != nil { + return ASInfoReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) RevNotification() (RevNotification, error) { + if s.Struct.Uint16(8) != 5 { + panic("Which() != revNotification") + } + p, err := s.Struct.Ptr(0) + return RevNotification{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasRevNotification() bool { + if s.Struct.Uint16(8) != 5 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetRevNotification(v RevNotification) error { + s.Struct.SetUint16(8, 5) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewRevNotification sets the revNotification field to a newly +// allocated RevNotification struct, preferring placement in s's segment. +func (s SCIONDMsg) NewRevNotification() (RevNotification, error) { + s.Struct.SetUint16(8, 5) + ss, err := NewRevNotification(s.Struct.Segment()) + if err != nil { + return RevNotification{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) IfInfoRequest() (IFInfoRequest, error) { + if s.Struct.Uint16(8) != 6 { + panic("Which() != ifInfoRequest") + } + p, err := s.Struct.Ptr(0) + return IFInfoRequest{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasIfInfoRequest() bool { + if s.Struct.Uint16(8) != 6 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetIfInfoRequest(v IFInfoRequest) error { + s.Struct.SetUint16(8, 6) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewIfInfoRequest sets the ifInfoRequest field to a newly +// allocated IFInfoRequest struct, preferring placement in s's segment. +func (s SCIONDMsg) NewIfInfoRequest() (IFInfoRequest, error) { + s.Struct.SetUint16(8, 6) + ss, err := NewIFInfoRequest(s.Struct.Segment()) + if err != nil { + return IFInfoRequest{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) IfInfoReply() (IFInfoReply, error) { + if s.Struct.Uint16(8) != 7 { + panic("Which() != ifInfoReply") + } + p, err := s.Struct.Ptr(0) + return IFInfoReply{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasIfInfoReply() bool { + if s.Struct.Uint16(8) != 7 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetIfInfoReply(v IFInfoReply) error { + s.Struct.SetUint16(8, 7) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewIfInfoReply sets the ifInfoReply field to a newly +// allocated IFInfoReply struct, preferring placement in s's segment. +func (s SCIONDMsg) NewIfInfoReply() (IFInfoReply, error) { + s.Struct.SetUint16(8, 7) + ss, err := NewIFInfoReply(s.Struct.Segment()) + if err != nil { + return IFInfoReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) ServiceInfoRequest() (ServiceInfoRequest, error) { + if s.Struct.Uint16(8) != 8 { + panic("Which() != serviceInfoRequest") + } + p, err := s.Struct.Ptr(0) + return ServiceInfoRequest{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasServiceInfoRequest() bool { + if s.Struct.Uint16(8) != 8 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetServiceInfoRequest(v ServiceInfoRequest) error { + s.Struct.SetUint16(8, 8) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewServiceInfoRequest sets the serviceInfoRequest field to a newly +// allocated ServiceInfoRequest struct, preferring placement in s's segment. +func (s SCIONDMsg) NewServiceInfoRequest() (ServiceInfoRequest, error) { + s.Struct.SetUint16(8, 8) + ss, err := NewServiceInfoRequest(s.Struct.Segment()) + if err != nil { + return ServiceInfoRequest{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) ServiceInfoReply() (ServiceInfoReply, error) { + if s.Struct.Uint16(8) != 9 { + panic("Which() != serviceInfoReply") + } + p, err := s.Struct.Ptr(0) + return ServiceInfoReply{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasServiceInfoReply() bool { + if s.Struct.Uint16(8) != 9 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetServiceInfoReply(v ServiceInfoReply) error { + s.Struct.SetUint16(8, 9) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewServiceInfoReply sets the serviceInfoReply field to a newly +// allocated ServiceInfoReply struct, preferring placement in s's segment. +func (s SCIONDMsg) NewServiceInfoReply() (ServiceInfoReply, error) { + s.Struct.SetUint16(8, 9) + ss, err := NewServiceInfoReply(s.Struct.Segment()) + if err != nil { + return ServiceInfoReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) RevReply() (RevReply, error) { + if s.Struct.Uint16(8) != 10 { + panic("Which() != revReply") + } + p, err := s.Struct.Ptr(0) + return RevReply{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasRevReply() bool { + if s.Struct.Uint16(8) != 10 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetRevReply(v RevReply) error { + s.Struct.SetUint16(8, 10) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewRevReply sets the revReply field to a newly +// allocated RevReply struct, preferring placement in s's segment. +func (s SCIONDMsg) NewRevReply() (RevReply, error) { + s.Struct.SetUint16(8, 10) + ss, err := NewRevReply(s.Struct.Segment()) + if err != nil { + return RevReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) SegTypeHopReq() (SegTypeHopReq, error) { + if s.Struct.Uint16(8) != 11 { + panic("Which() != segTypeHopReq") + } + p, err := s.Struct.Ptr(0) + return SegTypeHopReq{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasSegTypeHopReq() bool { + if s.Struct.Uint16(8) != 11 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetSegTypeHopReq(v SegTypeHopReq) error { + s.Struct.SetUint16(8, 11) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegTypeHopReq sets the segTypeHopReq field to a newly +// allocated SegTypeHopReq struct, preferring placement in s's segment. +func (s SCIONDMsg) NewSegTypeHopReq() (SegTypeHopReq, error) { + s.Struct.SetUint16(8, 11) + ss, err := NewSegTypeHopReq(s.Struct.Segment()) + if err != nil { + return SegTypeHopReq{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SCIONDMsg) SegTypeHopReply() (SegTypeHopReply, error) { + if s.Struct.Uint16(8) != 12 { + panic("Which() != segTypeHopReply") + } + p, err := s.Struct.Ptr(0) + return SegTypeHopReply{Struct: p.Struct()}, err +} + +func (s SCIONDMsg) HasSegTypeHopReply() bool { + if s.Struct.Uint16(8) != 12 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SCIONDMsg) SetSegTypeHopReply(v SegTypeHopReply) error { + s.Struct.SetUint16(8, 12) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSegTypeHopReply sets the segTypeHopReply field to a newly +// allocated SegTypeHopReply struct, preferring placement in s's segment. +func (s SCIONDMsg) NewSegTypeHopReply() (SegTypeHopReply, error) { + s.Struct.SetUint16(8, 12) + ss, err := NewSegTypeHopReply(s.Struct.Segment()) + if err != nil { + return SegTypeHopReply{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// SCIONDMsg_List is a list of SCIONDMsg. +type SCIONDMsg_List struct{ capnp.List } + +// NewSCIONDMsg creates a new list of SCIONDMsg. +func NewSCIONDMsg_List(s *capnp.Segment, sz int32) (SCIONDMsg_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}, sz) + return SCIONDMsg_List{l}, err +} + +func (s SCIONDMsg_List) At(i int) SCIONDMsg { return SCIONDMsg{s.List.Struct(i)} } + +func (s SCIONDMsg_List) Set(i int, v SCIONDMsg) error { return s.List.SetStruct(i, v.Struct) } + +func (s SCIONDMsg_List) String() string { + str, _ := text.MarshalList(0x91ea9bb47f46c346, s.List) + return str +} + +// SCIONDMsg_Promise is a wrapper for a SCIONDMsg promised by a client call. +type SCIONDMsg_Promise struct{ *capnp.Pipeline } + +func (p SCIONDMsg_Promise) Struct() (SCIONDMsg, error) { + s, err := p.Pipeline.Struct() + return SCIONDMsg{s}, err +} + +func (p SCIONDMsg_Promise) PathReq() PathReq_Promise { + return PathReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) PathReply() PathReply_Promise { + return PathReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) AsInfoReq() ASInfoReq_Promise { + return ASInfoReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) AsInfoReply() ASInfoReply_Promise { + return ASInfoReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) RevNotification() RevNotification_Promise { + return RevNotification_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) IfInfoRequest() IFInfoRequest_Promise { + return IFInfoRequest_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) IfInfoReply() IFInfoReply_Promise { + return IFInfoReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) ServiceInfoRequest() ServiceInfoRequest_Promise { + return ServiceInfoRequest_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) ServiceInfoReply() ServiceInfoReply_Promise { + return ServiceInfoReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) RevReply() RevReply_Promise { + return RevReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) SegTypeHopReq() SegTypeHopReq_Promise { + return SegTypeHopReq_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SCIONDMsg_Promise) SegTypeHopReply() SegTypeHopReply_Promise { + return SegTypeHopReply_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type PathReq struct{ capnp.Struct } +type PathReq_flags PathReq + +// PathReq_TypeID is the unique identifier for the type PathReq. +const PathReq_TypeID = 0xc4c61531dcc4a3eb + +func NewPathReq(s *capnp.Segment) (PathReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 1}) + return PathReq{st}, err +} + +func NewRootPathReq(s *capnp.Segment) (PathReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 24, PointerCount: 1}) + return PathReq{st}, err +} + +func ReadRootPathReq(msg *capnp.Message) (PathReq, error) { + root, err := msg.RootPtr() + return PathReq{root.Struct()}, err +} + +func (s PathReq) String() string { + str, _ := text.Marshal(0xc4c61531dcc4a3eb, s.Struct) + return str +} + +func (s PathReq) Dst() uint64 { + return s.Struct.Uint64(0) +} + +func (s PathReq) SetDst(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s PathReq) Src() uint64 { + return s.Struct.Uint64(8) +} + +func (s PathReq) SetSrc(v uint64) { + s.Struct.SetUint64(8, v) +} + +func (s PathReq) MaxPaths() uint16 { + return s.Struct.Uint16(16) +} + +func (s PathReq) SetMaxPaths(v uint16) { + s.Struct.SetUint16(16, v) +} + +func (s PathReq) Flags() PathReq_flags { return PathReq_flags(s) } + +func (s PathReq_flags) Refresh() bool { + return s.Struct.Bit(144) +} + +func (s PathReq_flags) SetRefresh(v bool) { + s.Struct.SetBit(144, v) +} + +func (s PathReq_flags) Hidden() bool { + return s.Struct.Bit(145) +} + +func (s PathReq_flags) SetHidden(v bool) { + s.Struct.SetBit(145, v) +} + +func (s PathReq) HpCfgs() (HPGroupId_List, error) { + p, err := s.Struct.Ptr(0) + return HPGroupId_List{List: p.List()}, err +} + +func (s PathReq) HasHpCfgs() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathReq) SetHpCfgs(v HPGroupId_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewHpCfgs sets the hpCfgs field to a newly +// allocated HPGroupId_List, preferring placement in s's segment. +func (s PathReq) NewHpCfgs(n int32) (HPGroupId_List, error) { + l, err := NewHPGroupId_List(s.Struct.Segment(), n) + if err != nil { + return HPGroupId_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// PathReq_List is a list of PathReq. +type PathReq_List struct{ capnp.List } + +// NewPathReq creates a new list of PathReq. +func NewPathReq_List(s *capnp.Segment, sz int32) (PathReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 24, PointerCount: 1}, sz) + return PathReq_List{l}, err +} + +func (s PathReq_List) At(i int) PathReq { return PathReq{s.List.Struct(i)} } + +func (s PathReq_List) Set(i int, v PathReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathReq_List) String() string { + str, _ := text.MarshalList(0xc4c61531dcc4a3eb, s.List) + return str +} + +// PathReq_Promise is a wrapper for a PathReq promised by a client call. +type PathReq_Promise struct{ *capnp.Pipeline } + +func (p PathReq_Promise) Struct() (PathReq, error) { + s, err := p.Pipeline.Struct() + return PathReq{s}, err +} + +func (p PathReq_Promise) Flags() PathReq_flags_Promise { return PathReq_flags_Promise{p.Pipeline} } + +// PathReq_flags_Promise is a wrapper for a PathReq_flags promised by a client call. +type PathReq_flags_Promise struct{ *capnp.Pipeline } + +func (p PathReq_flags_Promise) Struct() (PathReq_flags, error) { + s, err := p.Pipeline.Struct() + return PathReq_flags{s}, err +} + +type PathReply struct{ capnp.Struct } + +// PathReply_TypeID is the unique identifier for the type PathReply. +const PathReply_TypeID = 0xf10fe9b6293ee63f + +func NewPathReply(s *capnp.Segment) (PathReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PathReply{st}, err +} + +func NewRootPathReply(s *capnp.Segment) (PathReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return PathReply{st}, err +} + +func ReadRootPathReply(msg *capnp.Message) (PathReply, error) { + root, err := msg.RootPtr() + return PathReply{root.Struct()}, err +} + +func (s PathReply) String() string { + str, _ := text.Marshal(0xf10fe9b6293ee63f, s.Struct) + return str +} + +func (s PathReply) ErrorCode() uint16 { + return s.Struct.Uint16(0) +} + +func (s PathReply) SetErrorCode(v uint16) { + s.Struct.SetUint16(0, v) +} + +func (s PathReply) Entries() (PathReplyEntry_List, error) { + p, err := s.Struct.Ptr(0) + return PathReplyEntry_List{List: p.List()}, err +} + +func (s PathReply) HasEntries() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathReply) SetEntries(v PathReplyEntry_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewEntries sets the entries field to a newly +// allocated PathReplyEntry_List, preferring placement in s's segment. +func (s PathReply) NewEntries(n int32) (PathReplyEntry_List, error) { + l, err := NewPathReplyEntry_List(s.Struct.Segment(), n) + if err != nil { + return PathReplyEntry_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// PathReply_List is a list of PathReply. +type PathReply_List struct{ capnp.List } + +// NewPathReply creates a new list of PathReply. +func NewPathReply_List(s *capnp.Segment, sz int32) (PathReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return PathReply_List{l}, err +} + +func (s PathReply_List) At(i int) PathReply { return PathReply{s.List.Struct(i)} } + +func (s PathReply_List) Set(i int, v PathReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathReply_List) String() string { + str, _ := text.MarshalList(0xf10fe9b6293ee63f, s.List) + return str +} + +// PathReply_Promise is a wrapper for a PathReply promised by a client call. +type PathReply_Promise struct{ *capnp.Pipeline } + +func (p PathReply_Promise) Struct() (PathReply, error) { + s, err := p.Pipeline.Struct() + return PathReply{s}, err +} + +type PathReplyEntry struct{ capnp.Struct } + +// PathReplyEntry_TypeID is the unique identifier for the type PathReplyEntry. +const PathReplyEntry_TypeID = 0xc5ff2e54709776ec + +func NewPathReplyEntry(s *capnp.Segment) (PathReplyEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return PathReplyEntry{st}, err +} + +func NewRootPathReplyEntry(s *capnp.Segment) (PathReplyEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return PathReplyEntry{st}, err +} + +func ReadRootPathReplyEntry(msg *capnp.Message) (PathReplyEntry, error) { + root, err := msg.RootPtr() + return PathReplyEntry{root.Struct()}, err +} + +func (s PathReplyEntry) String() string { + str, _ := text.Marshal(0xc5ff2e54709776ec, s.Struct) + return str +} + +func (s PathReplyEntry) Path() (FwdPathMeta, error) { + p, err := s.Struct.Ptr(0) + return FwdPathMeta{Struct: p.Struct()}, err +} + +func (s PathReplyEntry) HasPath() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s PathReplyEntry) SetPath(v FwdPathMeta) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPath sets the path field to a newly +// allocated FwdPathMeta struct, preferring placement in s's segment. +func (s PathReplyEntry) NewPath() (FwdPathMeta, error) { + ss, err := NewFwdPathMeta(s.Struct.Segment()) + if err != nil { + return FwdPathMeta{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s PathReplyEntry) HostInfo() (HostInfo, error) { + p, err := s.Struct.Ptr(1) + return HostInfo{Struct: p.Struct()}, err +} + +func (s PathReplyEntry) HasHostInfo() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s PathReplyEntry) SetHostInfo(v HostInfo) error { + return s.Struct.SetPtr(1, v.Struct.ToPtr()) +} + +// NewHostInfo sets the hostInfo field to a newly +// allocated HostInfo struct, preferring placement in s's segment. +func (s PathReplyEntry) NewHostInfo() (HostInfo, error) { + ss, err := NewHostInfo(s.Struct.Segment()) + if err != nil { + return HostInfo{}, err + } + err = s.Struct.SetPtr(1, ss.Struct.ToPtr()) + return ss, err +} + +// PathReplyEntry_List is a list of PathReplyEntry. +type PathReplyEntry_List struct{ capnp.List } + +// NewPathReplyEntry creates a new list of PathReplyEntry. +func NewPathReplyEntry_List(s *capnp.Segment, sz int32) (PathReplyEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return PathReplyEntry_List{l}, err +} + +func (s PathReplyEntry_List) At(i int) PathReplyEntry { return PathReplyEntry{s.List.Struct(i)} } + +func (s PathReplyEntry_List) Set(i int, v PathReplyEntry) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathReplyEntry_List) String() string { + str, _ := text.MarshalList(0xc5ff2e54709776ec, s.List) + return str +} + +// PathReplyEntry_Promise is a wrapper for a PathReplyEntry promised by a client call. +type PathReplyEntry_Promise struct{ *capnp.Pipeline } + +func (p PathReplyEntry_Promise) Struct() (PathReplyEntry, error) { + s, err := p.Pipeline.Struct() + return PathReplyEntry{s}, err +} + +func (p PathReplyEntry_Promise) Path() FwdPathMeta_Promise { + return FwdPathMeta_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p PathReplyEntry_Promise) HostInfo() HostInfo_Promise { + return HostInfo_Promise{Pipeline: p.Pipeline.GetPipeline(1)} +} + +type HostInfo struct{ capnp.Struct } +type HostInfo_addrs HostInfo + +// HostInfo_TypeID is the unique identifier for the type HostInfo. +const HostInfo_TypeID = 0xb21a270577932520 + +func NewHostInfo(s *capnp.Segment) (HostInfo, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return HostInfo{st}, err +} + +func NewRootHostInfo(s *capnp.Segment) (HostInfo, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return HostInfo{st}, err +} + +func ReadRootHostInfo(msg *capnp.Message) (HostInfo, error) { + root, err := msg.RootPtr() + return HostInfo{root.Struct()}, err +} + +func (s HostInfo) String() string { + str, _ := text.Marshal(0xb21a270577932520, s.Struct) + return str +} + +func (s HostInfo) Port() uint16 { + return s.Struct.Uint16(0) +} + +func (s HostInfo) SetPort(v uint16) { + s.Struct.SetUint16(0, v) +} + +func (s HostInfo) Addrs() HostInfo_addrs { return HostInfo_addrs(s) } + +func (s HostInfo_addrs) Ipv4() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s HostInfo_addrs) HasIpv4() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s HostInfo_addrs) SetIpv4(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s HostInfo_addrs) Ipv6() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s HostInfo_addrs) HasIpv6() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s HostInfo_addrs) SetIpv6(v []byte) error { + return s.Struct.SetData(1, v) +} + +// HostInfo_List is a list of HostInfo. +type HostInfo_List struct{ capnp.List } + +// NewHostInfo creates a new list of HostInfo. +func NewHostInfo_List(s *capnp.Segment, sz int32) (HostInfo_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}, sz) + return HostInfo_List{l}, err +} + +func (s HostInfo_List) At(i int) HostInfo { return HostInfo{s.List.Struct(i)} } + +func (s HostInfo_List) Set(i int, v HostInfo) error { return s.List.SetStruct(i, v.Struct) } + +func (s HostInfo_List) String() string { + str, _ := text.MarshalList(0xb21a270577932520, s.List) + return str +} + +// HostInfo_Promise is a wrapper for a HostInfo promised by a client call. +type HostInfo_Promise struct{ *capnp.Pipeline } + +func (p HostInfo_Promise) Struct() (HostInfo, error) { + s, err := p.Pipeline.Struct() + return HostInfo{s}, err +} + +func (p HostInfo_Promise) Addrs() HostInfo_addrs_Promise { return HostInfo_addrs_Promise{p.Pipeline} } + +// HostInfo_addrs_Promise is a wrapper for a HostInfo_addrs promised by a client call. +type HostInfo_addrs_Promise struct{ *capnp.Pipeline } + +func (p HostInfo_addrs_Promise) Struct() (HostInfo_addrs, error) { + s, err := p.Pipeline.Struct() + return HostInfo_addrs{s}, err +} + +type FwdPathMeta struct{ capnp.Struct } + +// FwdPathMeta_TypeID is the unique identifier for the type FwdPathMeta. +const FwdPathMeta_TypeID = 0x8adfcabe5ff9daf4 + +func NewFwdPathMeta(s *capnp.Segment) (FwdPathMeta, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return FwdPathMeta{st}, err +} + +func NewRootFwdPathMeta(s *capnp.Segment) (FwdPathMeta, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return FwdPathMeta{st}, err +} + +func ReadRootFwdPathMeta(msg *capnp.Message) (FwdPathMeta, error) { + root, err := msg.RootPtr() + return FwdPathMeta{root.Struct()}, err +} + +func (s FwdPathMeta) String() string { + str, _ := text.Marshal(0x8adfcabe5ff9daf4, s.Struct) + return str +} + +func (s FwdPathMeta) FwdPath() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s FwdPathMeta) HasFwdPath() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s FwdPathMeta) SetFwdPath(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s FwdPathMeta) Mtu() uint16 { + return s.Struct.Uint16(0) +} + +func (s FwdPathMeta) SetMtu(v uint16) { + s.Struct.SetUint16(0, v) +} + +func (s FwdPathMeta) Interfaces() (PathInterface_List, error) { + p, err := s.Struct.Ptr(1) + return PathInterface_List{List: p.List()}, err +} + +func (s FwdPathMeta) HasInterfaces() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s FwdPathMeta) SetInterfaces(v PathInterface_List) error { + return s.Struct.SetPtr(1, v.List.ToPtr()) +} + +// NewInterfaces sets the interfaces field to a newly +// allocated PathInterface_List, preferring placement in s's segment. +func (s FwdPathMeta) NewInterfaces(n int32) (PathInterface_List, error) { + l, err := NewPathInterface_List(s.Struct.Segment(), n) + if err != nil { + return PathInterface_List{}, err + } + err = s.Struct.SetPtr(1, l.List.ToPtr()) + return l, err +} + +func (s FwdPathMeta) ExpTime() uint32 { + return s.Struct.Uint32(4) +} + +func (s FwdPathMeta) SetExpTime(v uint32) { + s.Struct.SetUint32(4, v) +} + +// FwdPathMeta_List is a list of FwdPathMeta. +type FwdPathMeta_List struct{ capnp.List } + +// NewFwdPathMeta creates a new list of FwdPathMeta. +func NewFwdPathMeta_List(s *capnp.Segment, sz int32) (FwdPathMeta_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}, sz) + return FwdPathMeta_List{l}, err +} + +func (s FwdPathMeta_List) At(i int) FwdPathMeta { return FwdPathMeta{s.List.Struct(i)} } + +func (s FwdPathMeta_List) Set(i int, v FwdPathMeta) error { return s.List.SetStruct(i, v.Struct) } + +func (s FwdPathMeta_List) String() string { + str, _ := text.MarshalList(0x8adfcabe5ff9daf4, s.List) + return str +} + +// FwdPathMeta_Promise is a wrapper for a FwdPathMeta promised by a client call. +type FwdPathMeta_Promise struct{ *capnp.Pipeline } + +func (p FwdPathMeta_Promise) Struct() (FwdPathMeta, error) { + s, err := p.Pipeline.Struct() + return FwdPathMeta{s}, err +} + +type PathInterface struct{ capnp.Struct } + +// PathInterface_TypeID is the unique identifier for the type PathInterface. +const PathInterface_TypeID = 0x95794035a80b7da1 + +func NewPathInterface(s *capnp.Segment) (PathInterface, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return PathInterface{st}, err +} + +func NewRootPathInterface(s *capnp.Segment) (PathInterface, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return PathInterface{st}, err +} + +func ReadRootPathInterface(msg *capnp.Message) (PathInterface, error) { + root, err := msg.RootPtr() + return PathInterface{root.Struct()}, err +} + +func (s PathInterface) String() string { + str, _ := text.Marshal(0x95794035a80b7da1, s.Struct) + return str +} + +func (s PathInterface) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s PathInterface) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s PathInterface) IfID() uint64 { + return s.Struct.Uint64(8) +} + +func (s PathInterface) SetIfID(v uint64) { + s.Struct.SetUint64(8, v) +} + +// PathInterface_List is a list of PathInterface. +type PathInterface_List struct{ capnp.List } + +// NewPathInterface creates a new list of PathInterface. +func NewPathInterface_List(s *capnp.Segment, sz int32) (PathInterface_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}, sz) + return PathInterface_List{l}, err +} + +func (s PathInterface_List) At(i int) PathInterface { return PathInterface{s.List.Struct(i)} } + +func (s PathInterface_List) Set(i int, v PathInterface) error { return s.List.SetStruct(i, v.Struct) } + +func (s PathInterface_List) String() string { + str, _ := text.MarshalList(0x95794035a80b7da1, s.List) + return str +} + +// PathInterface_Promise is a wrapper for a PathInterface promised by a client call. +type PathInterface_Promise struct{ *capnp.Pipeline } + +func (p PathInterface_Promise) Struct() (PathInterface, error) { + s, err := p.Pipeline.Struct() + return PathInterface{s}, err +} + +type ASInfoReq struct{ capnp.Struct } + +// ASInfoReq_TypeID is the unique identifier for the type ASInfoReq. +const ASInfoReq_TypeID = 0xcc65a2a89c24e6a5 + +func NewASInfoReq(s *capnp.Segment) (ASInfoReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return ASInfoReq{st}, err +} + +func NewRootASInfoReq(s *capnp.Segment) (ASInfoReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return ASInfoReq{st}, err +} + +func ReadRootASInfoReq(msg *capnp.Message) (ASInfoReq, error) { + root, err := msg.RootPtr() + return ASInfoReq{root.Struct()}, err +} + +func (s ASInfoReq) String() string { + str, _ := text.Marshal(0xcc65a2a89c24e6a5, s.Struct) + return str +} + +func (s ASInfoReq) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s ASInfoReq) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +// ASInfoReq_List is a list of ASInfoReq. +type ASInfoReq_List struct{ capnp.List } + +// NewASInfoReq creates a new list of ASInfoReq. +func NewASInfoReq_List(s *capnp.Segment, sz int32) (ASInfoReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return ASInfoReq_List{l}, err +} + +func (s ASInfoReq_List) At(i int) ASInfoReq { return ASInfoReq{s.List.Struct(i)} } + +func (s ASInfoReq_List) Set(i int, v ASInfoReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s ASInfoReq_List) String() string { + str, _ := text.MarshalList(0xcc65a2a89c24e6a5, s.List) + return str +} + +// ASInfoReq_Promise is a wrapper for a ASInfoReq promised by a client call. +type ASInfoReq_Promise struct{ *capnp.Pipeline } + +func (p ASInfoReq_Promise) Struct() (ASInfoReq, error) { + s, err := p.Pipeline.Struct() + return ASInfoReq{s}, err +} + +type ASInfoReply struct{ capnp.Struct } + +// ASInfoReply_TypeID is the unique identifier for the type ASInfoReply. +const ASInfoReply_TypeID = 0x947e1828e214e89d + +func NewASInfoReply(s *capnp.Segment) (ASInfoReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return ASInfoReply{st}, err +} + +func NewRootASInfoReply(s *capnp.Segment) (ASInfoReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return ASInfoReply{st}, err +} + +func ReadRootASInfoReply(msg *capnp.Message) (ASInfoReply, error) { + root, err := msg.RootPtr() + return ASInfoReply{root.Struct()}, err +} + +func (s ASInfoReply) String() string { + str, _ := text.Marshal(0x947e1828e214e89d, s.Struct) + return str +} + +func (s ASInfoReply) Entries() (ASInfoReplyEntry_List, error) { + p, err := s.Struct.Ptr(0) + return ASInfoReplyEntry_List{List: p.List()}, err +} + +func (s ASInfoReply) HasEntries() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s ASInfoReply) SetEntries(v ASInfoReplyEntry_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewEntries sets the entries field to a newly +// allocated ASInfoReplyEntry_List, preferring placement in s's segment. +func (s ASInfoReply) NewEntries(n int32) (ASInfoReplyEntry_List, error) { + l, err := NewASInfoReplyEntry_List(s.Struct.Segment(), n) + if err != nil { + return ASInfoReplyEntry_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// ASInfoReply_List is a list of ASInfoReply. +type ASInfoReply_List struct{ capnp.List } + +// NewASInfoReply creates a new list of ASInfoReply. +func NewASInfoReply_List(s *capnp.Segment, sz int32) (ASInfoReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return ASInfoReply_List{l}, err +} + +func (s ASInfoReply_List) At(i int) ASInfoReply { return ASInfoReply{s.List.Struct(i)} } + +func (s ASInfoReply_List) Set(i int, v ASInfoReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s ASInfoReply_List) String() string { + str, _ := text.MarshalList(0x947e1828e214e89d, s.List) + return str +} + +// ASInfoReply_Promise is a wrapper for a ASInfoReply promised by a client call. +type ASInfoReply_Promise struct{ *capnp.Pipeline } + +func (p ASInfoReply_Promise) Struct() (ASInfoReply, error) { + s, err := p.Pipeline.Struct() + return ASInfoReply{s}, err +} + +type ASInfoReplyEntry struct{ capnp.Struct } + +// ASInfoReplyEntry_TypeID is the unique identifier for the type ASInfoReplyEntry. +const ASInfoReplyEntry_TypeID = 0xfab1a3b4477ab6b3 + +func NewASInfoReplyEntry(s *capnp.Segment) (ASInfoReplyEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return ASInfoReplyEntry{st}, err +} + +func NewRootASInfoReplyEntry(s *capnp.Segment) (ASInfoReplyEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}) + return ASInfoReplyEntry{st}, err +} + +func ReadRootASInfoReplyEntry(msg *capnp.Message) (ASInfoReplyEntry, error) { + root, err := msg.RootPtr() + return ASInfoReplyEntry{root.Struct()}, err +} + +func (s ASInfoReplyEntry) String() string { + str, _ := text.Marshal(0xfab1a3b4477ab6b3, s.Struct) + return str +} + +func (s ASInfoReplyEntry) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s ASInfoReplyEntry) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s ASInfoReplyEntry) Mtu() uint16 { + return s.Struct.Uint16(8) +} + +func (s ASInfoReplyEntry) SetMtu(v uint16) { + s.Struct.SetUint16(8, v) +} + +func (s ASInfoReplyEntry) IsCore() bool { + return s.Struct.Bit(80) +} + +func (s ASInfoReplyEntry) SetIsCore(v bool) { + s.Struct.SetBit(80, v) +} + +// ASInfoReplyEntry_List is a list of ASInfoReplyEntry. +type ASInfoReplyEntry_List struct{ capnp.List } + +// NewASInfoReplyEntry creates a new list of ASInfoReplyEntry. +func NewASInfoReplyEntry_List(s *capnp.Segment, sz int32) (ASInfoReplyEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 0}, sz) + return ASInfoReplyEntry_List{l}, err +} + +func (s ASInfoReplyEntry_List) At(i int) ASInfoReplyEntry { return ASInfoReplyEntry{s.List.Struct(i)} } + +func (s ASInfoReplyEntry_List) Set(i int, v ASInfoReplyEntry) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s ASInfoReplyEntry_List) String() string { + str, _ := text.MarshalList(0xfab1a3b4477ab6b3, s.List) + return str +} + +// ASInfoReplyEntry_Promise is a wrapper for a ASInfoReplyEntry promised by a client call. +type ASInfoReplyEntry_Promise struct{ *capnp.Pipeline } + +func (p ASInfoReplyEntry_Promise) Struct() (ASInfoReplyEntry, error) { + s, err := p.Pipeline.Struct() + return ASInfoReplyEntry{s}, err +} + +type RevNotification struct{ capnp.Struct } + +// RevNotification_TypeID is the unique identifier for the type RevNotification. +const RevNotification_TypeID = 0x9b0685a785df42e9 + +func NewRevNotification(s *capnp.Segment) (RevNotification, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return RevNotification{st}, err +} + +func NewRootRevNotification(s *capnp.Segment) (RevNotification, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return RevNotification{st}, err +} + +func ReadRootRevNotification(msg *capnp.Message) (RevNotification, error) { + root, err := msg.RootPtr() + return RevNotification{root.Struct()}, err +} + +func (s RevNotification) String() string { + str, _ := text.Marshal(0x9b0685a785df42e9, s.Struct) + return str +} + +func (s RevNotification) SRevInfo() (SignedBlob, error) { + p, err := s.Struct.Ptr(0) + return SignedBlob{Struct: p.Struct()}, err +} + +func (s RevNotification) HasSRevInfo() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s RevNotification) SetSRevInfo(v SignedBlob) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewSRevInfo sets the sRevInfo field to a newly +// allocated SignedBlob struct, preferring placement in s's segment. +func (s RevNotification) NewSRevInfo() (SignedBlob, error) { + ss, err := NewSignedBlob(s.Struct.Segment()) + if err != nil { + return SignedBlob{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// RevNotification_List is a list of RevNotification. +type RevNotification_List struct{ capnp.List } + +// NewRevNotification creates a new list of RevNotification. +func NewRevNotification_List(s *capnp.Segment, sz int32) (RevNotification_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return RevNotification_List{l}, err +} + +func (s RevNotification_List) At(i int) RevNotification { return RevNotification{s.List.Struct(i)} } + +func (s RevNotification_List) Set(i int, v RevNotification) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s RevNotification_List) String() string { + str, _ := text.MarshalList(0x9b0685a785df42e9, s.List) + return str +} + +// RevNotification_Promise is a wrapper for a RevNotification promised by a client call. +type RevNotification_Promise struct{ *capnp.Pipeline } + +func (p RevNotification_Promise) Struct() (RevNotification, error) { + s, err := p.Pipeline.Struct() + return RevNotification{s}, err +} + +func (p RevNotification_Promise) SRevInfo() SignedBlob_Promise { + return SignedBlob_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type RevReply struct{ capnp.Struct } + +// RevReply_TypeID is the unique identifier for the type RevReply. +const RevReply_TypeID = 0x8f8172e4469c111a + +func NewRevReply(s *capnp.Segment) (RevReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return RevReply{st}, err +} + +func NewRootRevReply(s *capnp.Segment) (RevReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return RevReply{st}, err +} + +func ReadRootRevReply(msg *capnp.Message) (RevReply, error) { + root, err := msg.RootPtr() + return RevReply{root.Struct()}, err +} + +func (s RevReply) String() string { + str, _ := text.Marshal(0x8f8172e4469c111a, s.Struct) + return str +} + +func (s RevReply) Result() uint16 { + return s.Struct.Uint16(0) +} + +func (s RevReply) SetResult(v uint16) { + s.Struct.SetUint16(0, v) +} + +// RevReply_List is a list of RevReply. +type RevReply_List struct{ capnp.List } + +// NewRevReply creates a new list of RevReply. +func NewRevReply_List(s *capnp.Segment, sz int32) (RevReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return RevReply_List{l}, err +} + +func (s RevReply_List) At(i int) RevReply { return RevReply{s.List.Struct(i)} } + +func (s RevReply_List) Set(i int, v RevReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s RevReply_List) String() string { + str, _ := text.MarshalList(0x8f8172e4469c111a, s.List) + return str +} + +// RevReply_Promise is a wrapper for a RevReply promised by a client call. +type RevReply_Promise struct{ *capnp.Pipeline } + +func (p RevReply_Promise) Struct() (RevReply, error) { + s, err := p.Pipeline.Struct() + return RevReply{s}, err +} + +type IFInfoRequest struct{ capnp.Struct } + +// IFInfoRequest_TypeID is the unique identifier for the type IFInfoRequest. +const IFInfoRequest_TypeID = 0x877af4eba6adb0f3 + +func NewIFInfoRequest(s *capnp.Segment) (IFInfoRequest, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return IFInfoRequest{st}, err +} + +func NewRootIFInfoRequest(s *capnp.Segment) (IFInfoRequest, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return IFInfoRequest{st}, err +} + +func ReadRootIFInfoRequest(msg *capnp.Message) (IFInfoRequest, error) { + root, err := msg.RootPtr() + return IFInfoRequest{root.Struct()}, err +} + +func (s IFInfoRequest) String() string { + str, _ := text.Marshal(0x877af4eba6adb0f3, s.Struct) + return str +} + +func (s IFInfoRequest) IfIDs() (capnp.UInt64List, error) { + p, err := s.Struct.Ptr(0) + return capnp.UInt64List{List: p.List()}, err +} + +func (s IFInfoRequest) HasIfIDs() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s IFInfoRequest) SetIfIDs(v capnp.UInt64List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewIfIDs sets the ifIDs field to a newly +// allocated capnp.UInt64List, preferring placement in s's segment. +func (s IFInfoRequest) NewIfIDs(n int32) (capnp.UInt64List, error) { + l, err := capnp.NewUInt64List(s.Struct.Segment(), n) + if err != nil { + return capnp.UInt64List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// IFInfoRequest_List is a list of IFInfoRequest. +type IFInfoRequest_List struct{ capnp.List } + +// NewIFInfoRequest creates a new list of IFInfoRequest. +func NewIFInfoRequest_List(s *capnp.Segment, sz int32) (IFInfoRequest_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return IFInfoRequest_List{l}, err +} + +func (s IFInfoRequest_List) At(i int) IFInfoRequest { return IFInfoRequest{s.List.Struct(i)} } + +func (s IFInfoRequest_List) Set(i int, v IFInfoRequest) error { return s.List.SetStruct(i, v.Struct) } + +func (s IFInfoRequest_List) String() string { + str, _ := text.MarshalList(0x877af4eba6adb0f3, s.List) + return str +} + +// IFInfoRequest_Promise is a wrapper for a IFInfoRequest promised by a client call. +type IFInfoRequest_Promise struct{ *capnp.Pipeline } + +func (p IFInfoRequest_Promise) Struct() (IFInfoRequest, error) { + s, err := p.Pipeline.Struct() + return IFInfoRequest{s}, err +} + +type IFInfoReply struct{ capnp.Struct } + +// IFInfoReply_TypeID is the unique identifier for the type IFInfoReply. +const IFInfoReply_TypeID = 0xe7f7d11a5652e06c + +func NewIFInfoReply(s *capnp.Segment) (IFInfoReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return IFInfoReply{st}, err +} + +func NewRootIFInfoReply(s *capnp.Segment) (IFInfoReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return IFInfoReply{st}, err +} + +func ReadRootIFInfoReply(msg *capnp.Message) (IFInfoReply, error) { + root, err := msg.RootPtr() + return IFInfoReply{root.Struct()}, err +} + +func (s IFInfoReply) String() string { + str, _ := text.Marshal(0xe7f7d11a5652e06c, s.Struct) + return str +} + +func (s IFInfoReply) Entries() (IFInfoReplyEntry_List, error) { + p, err := s.Struct.Ptr(0) + return IFInfoReplyEntry_List{List: p.List()}, err +} + +func (s IFInfoReply) HasEntries() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s IFInfoReply) SetEntries(v IFInfoReplyEntry_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewEntries sets the entries field to a newly +// allocated IFInfoReplyEntry_List, preferring placement in s's segment. +func (s IFInfoReply) NewEntries(n int32) (IFInfoReplyEntry_List, error) { + l, err := NewIFInfoReplyEntry_List(s.Struct.Segment(), n) + if err != nil { + return IFInfoReplyEntry_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// IFInfoReply_List is a list of IFInfoReply. +type IFInfoReply_List struct{ capnp.List } + +// NewIFInfoReply creates a new list of IFInfoReply. +func NewIFInfoReply_List(s *capnp.Segment, sz int32) (IFInfoReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return IFInfoReply_List{l}, err +} + +func (s IFInfoReply_List) At(i int) IFInfoReply { return IFInfoReply{s.List.Struct(i)} } + +func (s IFInfoReply_List) Set(i int, v IFInfoReply) error { return s.List.SetStruct(i, v.Struct) } + +func (s IFInfoReply_List) String() string { + str, _ := text.MarshalList(0xe7f7d11a5652e06c, s.List) + return str +} + +// IFInfoReply_Promise is a wrapper for a IFInfoReply promised by a client call. +type IFInfoReply_Promise struct{ *capnp.Pipeline } + +func (p IFInfoReply_Promise) Struct() (IFInfoReply, error) { + s, err := p.Pipeline.Struct() + return IFInfoReply{s}, err +} + +type IFInfoReplyEntry struct{ capnp.Struct } + +// IFInfoReplyEntry_TypeID is the unique identifier for the type IFInfoReplyEntry. +const IFInfoReplyEntry_TypeID = 0xf0c5156786d72738 + +func NewIFInfoReplyEntry(s *capnp.Segment) (IFInfoReplyEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return IFInfoReplyEntry{st}, err +} + +func NewRootIFInfoReplyEntry(s *capnp.Segment) (IFInfoReplyEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return IFInfoReplyEntry{st}, err +} + +func ReadRootIFInfoReplyEntry(msg *capnp.Message) (IFInfoReplyEntry, error) { + root, err := msg.RootPtr() + return IFInfoReplyEntry{root.Struct()}, err +} + +func (s IFInfoReplyEntry) String() string { + str, _ := text.Marshal(0xf0c5156786d72738, s.Struct) + return str +} + +func (s IFInfoReplyEntry) IfID() uint64 { + return s.Struct.Uint64(0) +} + +func (s IFInfoReplyEntry) SetIfID(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s IFInfoReplyEntry) HostInfo() (HostInfo, error) { + p, err := s.Struct.Ptr(0) + return HostInfo{Struct: p.Struct()}, err +} + +func (s IFInfoReplyEntry) HasHostInfo() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s IFInfoReplyEntry) SetHostInfo(v HostInfo) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewHostInfo sets the hostInfo field to a newly +// allocated HostInfo struct, preferring placement in s's segment. +func (s IFInfoReplyEntry) NewHostInfo() (HostInfo, error) { + ss, err := NewHostInfo(s.Struct.Segment()) + if err != nil { + return HostInfo{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// IFInfoReplyEntry_List is a list of IFInfoReplyEntry. +type IFInfoReplyEntry_List struct{ capnp.List } + +// NewIFInfoReplyEntry creates a new list of IFInfoReplyEntry. +func NewIFInfoReplyEntry_List(s *capnp.Segment, sz int32) (IFInfoReplyEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return IFInfoReplyEntry_List{l}, err +} + +func (s IFInfoReplyEntry_List) At(i int) IFInfoReplyEntry { return IFInfoReplyEntry{s.List.Struct(i)} } + +func (s IFInfoReplyEntry_List) Set(i int, v IFInfoReplyEntry) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s IFInfoReplyEntry_List) String() string { + str, _ := text.MarshalList(0xf0c5156786d72738, s.List) + return str +} + +// IFInfoReplyEntry_Promise is a wrapper for a IFInfoReplyEntry promised by a client call. +type IFInfoReplyEntry_Promise struct{ *capnp.Pipeline } + +func (p IFInfoReplyEntry_Promise) Struct() (IFInfoReplyEntry, error) { + s, err := p.Pipeline.Struct() + return IFInfoReplyEntry{s}, err +} + +func (p IFInfoReplyEntry_Promise) HostInfo() HostInfo_Promise { + return HostInfo_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type ServiceInfoRequest struct{ capnp.Struct } + +// ServiceInfoRequest_TypeID is the unique identifier for the type ServiceInfoRequest. +const ServiceInfoRequest_TypeID = 0xa94f085c31a03112 + +func NewServiceInfoRequest(s *capnp.Segment) (ServiceInfoRequest, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return ServiceInfoRequest{st}, err +} + +func NewRootServiceInfoRequest(s *capnp.Segment) (ServiceInfoRequest, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return ServiceInfoRequest{st}, err +} + +func ReadRootServiceInfoRequest(msg *capnp.Message) (ServiceInfoRequest, error) { + root, err := msg.RootPtr() + return ServiceInfoRequest{root.Struct()}, err +} + +func (s ServiceInfoRequest) String() string { + str, _ := text.Marshal(0xa94f085c31a03112, s.Struct) + return str +} + +func (s ServiceInfoRequest) ServiceTypes() (ServiceType_List, error) { + p, err := s.Struct.Ptr(0) + return ServiceType_List{List: p.List()}, err +} + +func (s ServiceInfoRequest) HasServiceTypes() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s ServiceInfoRequest) SetServiceTypes(v ServiceType_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewServiceTypes sets the serviceTypes field to a newly +// allocated ServiceType_List, preferring placement in s's segment. +func (s ServiceInfoRequest) NewServiceTypes(n int32) (ServiceType_List, error) { + l, err := NewServiceType_List(s.Struct.Segment(), n) + if err != nil { + return ServiceType_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// ServiceInfoRequest_List is a list of ServiceInfoRequest. +type ServiceInfoRequest_List struct{ capnp.List } + +// NewServiceInfoRequest creates a new list of ServiceInfoRequest. +func NewServiceInfoRequest_List(s *capnp.Segment, sz int32) (ServiceInfoRequest_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return ServiceInfoRequest_List{l}, err +} + +func (s ServiceInfoRequest_List) At(i int) ServiceInfoRequest { + return ServiceInfoRequest{s.List.Struct(i)} +} + +func (s ServiceInfoRequest_List) Set(i int, v ServiceInfoRequest) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s ServiceInfoRequest_List) String() string { + str, _ := text.MarshalList(0xa94f085c31a03112, s.List) + return str +} + +// ServiceInfoRequest_Promise is a wrapper for a ServiceInfoRequest promised by a client call. +type ServiceInfoRequest_Promise struct{ *capnp.Pipeline } + +func (p ServiceInfoRequest_Promise) Struct() (ServiceInfoRequest, error) { + s, err := p.Pipeline.Struct() + return ServiceInfoRequest{s}, err +} + +type ServiceInfoReply struct{ capnp.Struct } + +// ServiceInfoReply_TypeID is the unique identifier for the type ServiceInfoReply. +const ServiceInfoReply_TypeID = 0xf7a6d78ba978beb9 + +func NewServiceInfoReply(s *capnp.Segment) (ServiceInfoReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return ServiceInfoReply{st}, err +} + +func NewRootServiceInfoReply(s *capnp.Segment) (ServiceInfoReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return ServiceInfoReply{st}, err +} + +func ReadRootServiceInfoReply(msg *capnp.Message) (ServiceInfoReply, error) { + root, err := msg.RootPtr() + return ServiceInfoReply{root.Struct()}, err +} + +func (s ServiceInfoReply) String() string { + str, _ := text.Marshal(0xf7a6d78ba978beb9, s.Struct) + return str +} + +func (s ServiceInfoReply) Entries() (ServiceInfoReplyEntry_List, error) { + p, err := s.Struct.Ptr(0) + return ServiceInfoReplyEntry_List{List: p.List()}, err +} + +func (s ServiceInfoReply) HasEntries() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s ServiceInfoReply) SetEntries(v ServiceInfoReplyEntry_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewEntries sets the entries field to a newly +// allocated ServiceInfoReplyEntry_List, preferring placement in s's segment. +func (s ServiceInfoReply) NewEntries(n int32) (ServiceInfoReplyEntry_List, error) { + l, err := NewServiceInfoReplyEntry_List(s.Struct.Segment(), n) + if err != nil { + return ServiceInfoReplyEntry_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// ServiceInfoReply_List is a list of ServiceInfoReply. +type ServiceInfoReply_List struct{ capnp.List } + +// NewServiceInfoReply creates a new list of ServiceInfoReply. +func NewServiceInfoReply_List(s *capnp.Segment, sz int32) (ServiceInfoReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return ServiceInfoReply_List{l}, err +} + +func (s ServiceInfoReply_List) At(i int) ServiceInfoReply { return ServiceInfoReply{s.List.Struct(i)} } + +func (s ServiceInfoReply_List) Set(i int, v ServiceInfoReply) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s ServiceInfoReply_List) String() string { + str, _ := text.MarshalList(0xf7a6d78ba978beb9, s.List) + return str +} + +// ServiceInfoReply_Promise is a wrapper for a ServiceInfoReply promised by a client call. +type ServiceInfoReply_Promise struct{ *capnp.Pipeline } + +func (p ServiceInfoReply_Promise) Struct() (ServiceInfoReply, error) { + s, err := p.Pipeline.Struct() + return ServiceInfoReply{s}, err +} + +type ServiceInfoReplyEntry struct{ capnp.Struct } + +// ServiceInfoReplyEntry_TypeID is the unique identifier for the type ServiceInfoReplyEntry. +const ServiceInfoReplyEntry_TypeID = 0xe7279389a6bbe1dc + +func NewServiceInfoReplyEntry(s *capnp.Segment) (ServiceInfoReplyEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return ServiceInfoReplyEntry{st}, err +} + +func NewRootServiceInfoReplyEntry(s *capnp.Segment) (ServiceInfoReplyEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return ServiceInfoReplyEntry{st}, err +} + +func ReadRootServiceInfoReplyEntry(msg *capnp.Message) (ServiceInfoReplyEntry, error) { + root, err := msg.RootPtr() + return ServiceInfoReplyEntry{root.Struct()}, err +} + +func (s ServiceInfoReplyEntry) String() string { + str, _ := text.Marshal(0xe7279389a6bbe1dc, s.Struct) + return str +} + +func (s ServiceInfoReplyEntry) ServiceType() ServiceType { + return ServiceType(s.Struct.Uint16(0)) +} + +func (s ServiceInfoReplyEntry) SetServiceType(v ServiceType) { + s.Struct.SetUint16(0, uint16(v)) +} + +func (s ServiceInfoReplyEntry) Ttl() uint32 { + return s.Struct.Uint32(4) +} + +func (s ServiceInfoReplyEntry) SetTtl(v uint32) { + s.Struct.SetUint32(4, v) +} + +func (s ServiceInfoReplyEntry) HostInfos() (HostInfo_List, error) { + p, err := s.Struct.Ptr(0) + return HostInfo_List{List: p.List()}, err +} + +func (s ServiceInfoReplyEntry) HasHostInfos() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s ServiceInfoReplyEntry) SetHostInfos(v HostInfo_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewHostInfos sets the hostInfos field to a newly +// allocated HostInfo_List, preferring placement in s's segment. +func (s ServiceInfoReplyEntry) NewHostInfos(n int32) (HostInfo_List, error) { + l, err := NewHostInfo_List(s.Struct.Segment(), n) + if err != nil { + return HostInfo_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// ServiceInfoReplyEntry_List is a list of ServiceInfoReplyEntry. +type ServiceInfoReplyEntry_List struct{ capnp.List } + +// NewServiceInfoReplyEntry creates a new list of ServiceInfoReplyEntry. +func NewServiceInfoReplyEntry_List(s *capnp.Segment, sz int32) (ServiceInfoReplyEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return ServiceInfoReplyEntry_List{l}, err +} + +func (s ServiceInfoReplyEntry_List) At(i int) ServiceInfoReplyEntry { + return ServiceInfoReplyEntry{s.List.Struct(i)} +} + +func (s ServiceInfoReplyEntry_List) Set(i int, v ServiceInfoReplyEntry) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s ServiceInfoReplyEntry_List) String() string { + str, _ := text.MarshalList(0xe7279389a6bbe1dc, s.List) + return str +} + +// ServiceInfoReplyEntry_Promise is a wrapper for a ServiceInfoReplyEntry promised by a client call. +type ServiceInfoReplyEntry_Promise struct{ *capnp.Pipeline } + +func (p ServiceInfoReplyEntry_Promise) Struct() (ServiceInfoReplyEntry, error) { + s, err := p.Pipeline.Struct() + return ServiceInfoReplyEntry{s}, err +} + +type SegTypeHopReq struct{ capnp.Struct } + +// SegTypeHopReq_TypeID is the unique identifier for the type SegTypeHopReq. +const SegTypeHopReq_TypeID = 0xca1e844241cf650f + +func NewSegTypeHopReq(s *capnp.Segment) (SegTypeHopReq, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return SegTypeHopReq{st}, err +} + +func NewRootSegTypeHopReq(s *capnp.Segment) (SegTypeHopReq, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}) + return SegTypeHopReq{st}, err +} + +func ReadRootSegTypeHopReq(msg *capnp.Message) (SegTypeHopReq, error) { + root, err := msg.RootPtr() + return SegTypeHopReq{root.Struct()}, err +} + +func (s SegTypeHopReq) String() string { + str, _ := text.Marshal(0xca1e844241cf650f, s.Struct) + return str +} + +func (s SegTypeHopReq) Type() PathSegType { + return PathSegType(s.Struct.Uint16(0)) +} + +func (s SegTypeHopReq) SetType(v PathSegType) { + s.Struct.SetUint16(0, uint16(v)) +} + +// SegTypeHopReq_List is a list of SegTypeHopReq. +type SegTypeHopReq_List struct{ capnp.List } + +// NewSegTypeHopReq creates a new list of SegTypeHopReq. +func NewSegTypeHopReq_List(s *capnp.Segment, sz int32) (SegTypeHopReq_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz) + return SegTypeHopReq_List{l}, err +} + +func (s SegTypeHopReq_List) At(i int) SegTypeHopReq { return SegTypeHopReq{s.List.Struct(i)} } + +func (s SegTypeHopReq_List) Set(i int, v SegTypeHopReq) error { return s.List.SetStruct(i, v.Struct) } + +func (s SegTypeHopReq_List) String() string { + str, _ := text.MarshalList(0xca1e844241cf650f, s.List) + return str +} + +// SegTypeHopReq_Promise is a wrapper for a SegTypeHopReq promised by a client call. +type SegTypeHopReq_Promise struct{ *capnp.Pipeline } + +func (p SegTypeHopReq_Promise) Struct() (SegTypeHopReq, error) { + s, err := p.Pipeline.Struct() + return SegTypeHopReq{s}, err +} + +type SegTypeHopReply struct{ capnp.Struct } + +// SegTypeHopReply_TypeID is the unique identifier for the type SegTypeHopReply. +const SegTypeHopReply_TypeID = 0xc340ede57616f2e8 + +func NewSegTypeHopReply(s *capnp.Segment) (SegTypeHopReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SegTypeHopReply{st}, err +} + +func NewRootSegTypeHopReply(s *capnp.Segment) (SegTypeHopReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SegTypeHopReply{st}, err +} + +func ReadRootSegTypeHopReply(msg *capnp.Message) (SegTypeHopReply, error) { + root, err := msg.RootPtr() + return SegTypeHopReply{root.Struct()}, err +} + +func (s SegTypeHopReply) String() string { + str, _ := text.Marshal(0xc340ede57616f2e8, s.Struct) + return str +} + +func (s SegTypeHopReply) Entries() (SegTypeHopReplyEntry_List, error) { + p, err := s.Struct.Ptr(0) + return SegTypeHopReplyEntry_List{List: p.List()}, err +} + +func (s SegTypeHopReply) HasEntries() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegTypeHopReply) SetEntries(v SegTypeHopReplyEntry_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewEntries sets the entries field to a newly +// allocated SegTypeHopReplyEntry_List, preferring placement in s's segment. +func (s SegTypeHopReply) NewEntries(n int32) (SegTypeHopReplyEntry_List, error) { + l, err := NewSegTypeHopReplyEntry_List(s.Struct.Segment(), n) + if err != nil { + return SegTypeHopReplyEntry_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// SegTypeHopReply_List is a list of SegTypeHopReply. +type SegTypeHopReply_List struct{ capnp.List } + +// NewSegTypeHopReply creates a new list of SegTypeHopReply. +func NewSegTypeHopReply_List(s *capnp.Segment, sz int32) (SegTypeHopReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return SegTypeHopReply_List{l}, err +} + +func (s SegTypeHopReply_List) At(i int) SegTypeHopReply { return SegTypeHopReply{s.List.Struct(i)} } + +func (s SegTypeHopReply_List) Set(i int, v SegTypeHopReply) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s SegTypeHopReply_List) String() string { + str, _ := text.MarshalList(0xc340ede57616f2e8, s.List) + return str +} + +// SegTypeHopReply_Promise is a wrapper for a SegTypeHopReply promised by a client call. +type SegTypeHopReply_Promise struct{ *capnp.Pipeline } + +func (p SegTypeHopReply_Promise) Struct() (SegTypeHopReply, error) { + s, err := p.Pipeline.Struct() + return SegTypeHopReply{s}, err +} + +type SegTypeHopReplyEntry struct{ capnp.Struct } + +// SegTypeHopReplyEntry_TypeID is the unique identifier for the type SegTypeHopReplyEntry. +const SegTypeHopReplyEntry_TypeID = 0xacf8185a51a9f1b4 + +func NewSegTypeHopReplyEntry(s *capnp.Segment) (SegTypeHopReplyEntry, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return SegTypeHopReplyEntry{st}, err +} + +func NewRootSegTypeHopReplyEntry(s *capnp.Segment) (SegTypeHopReplyEntry, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return SegTypeHopReplyEntry{st}, err +} + +func ReadRootSegTypeHopReplyEntry(msg *capnp.Message) (SegTypeHopReplyEntry, error) { + root, err := msg.RootPtr() + return SegTypeHopReplyEntry{root.Struct()}, err +} + +func (s SegTypeHopReplyEntry) String() string { + str, _ := text.Marshal(0xacf8185a51a9f1b4, s.Struct) + return str +} + +func (s SegTypeHopReplyEntry) Interfaces() (PathInterface_List, error) { + p, err := s.Struct.Ptr(0) + return PathInterface_List{List: p.List()}, err +} + +func (s SegTypeHopReplyEntry) HasInterfaces() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SegTypeHopReplyEntry) SetInterfaces(v PathInterface_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewInterfaces sets the interfaces field to a newly +// allocated PathInterface_List, preferring placement in s's segment. +func (s SegTypeHopReplyEntry) NewInterfaces(n int32) (PathInterface_List, error) { + l, err := NewPathInterface_List(s.Struct.Segment(), n) + if err != nil { + return PathInterface_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +func (s SegTypeHopReplyEntry) Timestamp() uint32 { + return s.Struct.Uint32(0) +} + +func (s SegTypeHopReplyEntry) SetTimestamp(v uint32) { + s.Struct.SetUint32(0, v) +} + +func (s SegTypeHopReplyEntry) ExpTime() uint32 { + return s.Struct.Uint32(4) +} + +func (s SegTypeHopReplyEntry) SetExpTime(v uint32) { + s.Struct.SetUint32(4, v) +} + +// SegTypeHopReplyEntry_List is a list of SegTypeHopReplyEntry. +type SegTypeHopReplyEntry_List struct{ capnp.List } + +// NewSegTypeHopReplyEntry creates a new list of SegTypeHopReplyEntry. +func NewSegTypeHopReplyEntry_List(s *capnp.Segment, sz int32) (SegTypeHopReplyEntry_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return SegTypeHopReplyEntry_List{l}, err +} + +func (s SegTypeHopReplyEntry_List) At(i int) SegTypeHopReplyEntry { + return SegTypeHopReplyEntry{s.List.Struct(i)} +} + +func (s SegTypeHopReplyEntry_List) Set(i int, v SegTypeHopReplyEntry) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s SegTypeHopReplyEntry_List) String() string { + str, _ := text.MarshalList(0xacf8185a51a9f1b4, s.List) + return str +} + +// SegTypeHopReplyEntry_Promise is a wrapper for a SegTypeHopReplyEntry promised by a client call. +type SegTypeHopReplyEntry_Promise struct{ *capnp.Pipeline } + +func (p SegTypeHopReplyEntry_Promise) Struct() (SegTypeHopReplyEntry, error) { + s, err := p.Pipeline.Struct() + return SegTypeHopReplyEntry{s}, err +} + +const schema_8f4bd412642c9517 = "x\xda\x94W}l[\xd5\x15?\xe7^\xbb\xb6\x13;" + + "\xb6\xfb\x1c\xa82m\x19UQ\x9b\x8aT$\xd0\xad\xaa" + + "4\xd2\xa6M\x88\xd9\x02yv6\x09\x04\x1a&~N" + + "<9\xb6\xfb\xdeK\x1a#\xba\xd0)\xd9X\x07\xa2\x08" + + "\xaa}\xb4h|\xac]\xb3\x81F\xbb\x16A\xa7!!" + + "\x9aM\x8b`\x03\x89\x89-*\x03:J\x9b\xb2iK" + + "iW\xd2\xad{\xd3y\xdf}}),\x7f]\xe7w" + + "|\xee\xf9\xfa\xfd\xce\xf5\xf5<\xb8\x81\xb5\x05\xff\x11\x02" + + "\x10\xef\x0c.\xd1>z\xee\xd9}\x1f\x9e\xbd\xf7;\x90" + + "\x8c\xa1v\xf5\xae\xeb\xf2K\xdf\xfc\xf2\xc3\x10\xc4\x10\x80" + + "\xf06\x9f\x15\xe68\x9dN\xf0\x0e@\xed\xec\xec\xc2\xd7" + + "_\x9ayg\x07\x881t\x1b32i\x0c\xcc\x08\xd7" + + "\x04\xe8\xf4\xd9\xc0I@\xad)\xb9\xa7\xfb}y\xfb\xc3" + + "\x1ec\xdd\"\x18<(\xc4\x82t\x8a\x04\xc9q\xf7+" + + "\xdd\xe3\x87v\x9f~\x84l\x99c\xdb\x85\xa1\x18\x06\x84" + + "\x96\xe0\x11\xa1\x8d\xacoh\x0d^\xcd\x01\xb5\xc7O\xa5" + + "\x8e\xafZ\xf6\xcd\xc7\xfcb~(<#\xfc0L\xa7" + + "]ar\xfd\xe4\xb6\xfa\xfdk7\xd4vy\\\xeba" + + "L\x87g\x857t\xdb\xd7\xc2[\x01\xb5\xb9\xcew&" + + "\x7f:\xb9d\xb7\x9f\xdf\x96\xc8iam\x84Nm\x11" + + "\xf2;\xfb\xe7\x1d\xa7\xde\x0b\xfe~7\x88\x8d\xc8\xb5\x0f" + + "\x9f>z\xac\xad\xf17G\xa1\x11C\x08 |52" + + "\x0b(\xdc\x1e!\xafK\xdb\x9eh\xbb3|\xdb\x94\x8f" + + "\xd7\x1b\x0eG\x18\x0a/\xebn\x7f\xad\xbb=4?%" + + "\xde\xb1\xec\xe3g\xbc%\xd6\xad\xe7#KQ\xc0:\xb2" + + "\xbe\x18\xf9\x05\xa0\xf6\xf9k\x1f\xdd\x1a\\\xd9t\xd0\xb7" + + "!\xcf\xd6\x1d\x14\x0e\xeb\xc6\x07\xea(\x8eSg\xae\x1a" + + "=\xf1\xf7\x0d\xaf\xf8e7_wZ\xb8\xa8\xdb.\xd4" + + "Q\x18v>b\x0c\xf9e\xa5\xa8\xff\x99\xd0V\xaf\xf7" + + "\xa3\xbe\x19\x01\xb5\xbf\x8d~\xbf\xda\xbfF\x9b\xf6x\xd6" + + "\xa3X\x1b=.l\x8c\xd2\xe9KQ\x8a\".\xfda" + + "c\xe7\xc4\xe7f\xfc\xc6\xe2\xf1\xe8\xac0\xa5\xdb\xee\x8d" + + "R\x14{?X\xb1g\xffS\xd2\xab~\xb6\xd3\xd1#" + + "\xc2k\xba\xed\xeft\xdbc\xef\xfdj\xdfw\x1f]y" + + "\xd2\xb7ps\xd1&\x14\x16t\xebsQ*\\\xe9\xdd" + + "\xcc\xd7\x9a\xde8\x7f\xd2\xaf\x16{c3\xc2\x81\x98^" + + "\xc1\x18y^\xb7\xf2\xado\x0f6N\xff\xd3\xcf\xb3\xf0" + + "v\xec\x8c0\xa7\x1b\x9f\x88Qz\x1d\x1f\xdc\xd4\xf2\xfc" + + "\\|\xde\xd7\xb8\xab\xe1\x88\xd0\xdb@\xa7t\x03\x19\xbf" + + "\xf8\xd2\xd8\xd4\xf7\xde\xdaw\xde/\x8a\x17\x1b\xce\x08\xd3" + + "\xba\xed\xcb\x0d\x14E\xb4\xe9/?\x1f\xbc\xf6\xc4\x02\x88" + + "W\xa1\xab\xf1\x8dL\x9f\xb7\xf9\x86\xe3\x80\xc29\xdd\xeb" + + "/\x9f\xbf\xf7\xe6CO\x1f\xb8\xe07\xf1b\xfc\x8cp" + + "W\x9cN\xb7\xc7\xa9\x0e\xca@\xb1R\xce\xaf\x19`\xb9" + + "j\xb9\xba>\xdd\x9d.\x17*\x19i\xcb\x88\xc4\x15\xb5" + + "\x0fQ\x0c\xf0\x00@\x00\x01\x92\xb1v\x001\xccQ\\" + + "\xc1\xb0\xb9XHoV\xb0\x01\xb0\x8f#F\x80\xd1\xd1" + + "\xe3\xab{k\xbe/\xa7\x0e\xf5Jj\x0e\x80\\%l" + + "W\xb9N\xd2\x1e\x8e\xe2\x10C\xc4\x14\xd2\xff\xa4\xe5\x00" + + "\xe2\xdd\x1c\xc5\x12\xc3$\xc3\x142\x80d\xf1\x0e\x00q" + + "\x88\xa38\xc10\xc91\x85\x1c \xb9\x9d\xbe}\x1fG" + + "\xf1\x01\x86\xe3\x05\xe3\x16\x8c\x01\xc3\x18`hX\x1d\xc1" + + "\x100\x0c\x01j\xc5\xb2*\xc9\x85\xdc\x00p\xc9\x8e5" + + "\xe1\xe8\x01 \xfds\\\x1a\xab\xf6\x17\x87%\x0c\x03\xc3" + + "\xb0+\x0b\xd4\xb3\xc8H\xa3\xcd\x19\xa9Z\xaay\x8a\xb1" + + "\xde,F\x8aa\x87,)#%\xd5\xbe\xf6R\x07\xd9" + + "M\xe9\x8e\xdbn\xdd\xdc\xab\x0c\x92\x87u\x96\x07\xa1\x86" + + "M\x00Y\x159f\xefG\x861\xd44\xbd\x10\xc26" + + "l\x07\xc8\x8e\x110A\x00\xfb\xaf\xa6\x17C\xd8\x8e\x9d" + + "\x00\xd9\xfb\x08x\x80\x00~Q\xd3\x0b\"Lb\x06 " + + ";A\xc0N\x02\x02\xff\xd1R\x18 )\xd4\x81\x07\x09" + + "\xf8\x01\x01\xc1\x7fk)\x0c\x922\xe2=\x00\xd9\xc7\x08" + + "x\x82\x80%\x17\xb4\x14.!\x02\xe2\xb7\x00\xb2{\x08" + + "\xd8O@hAK\x19\x9c@\x19 \xfb\x13\x02\x9e#" + + " \xfc\xb1\x96\xc20QDw\xf5\x0c\x01/\x10\x109" + + "\xaf\xa50\x02 \x1c\xc6\x1f\x01d_ \xe0(\x01u" + + "\xff\xd2RXG\xe3\x8c;\x00\xb2G\x09x\x9d\x80\xfa" + + "sZ\x0a\xebI\x83\xf1\x16\x80\xec\xab\x04\xfc\x89\x80\xe8" + + "Y-\x85Q\x00\xe1\x8f\xfa\xe5o\x12\xf0.\x01\xb1\x8f" + + "\xb4\x14\xc6\x88|z\xb8\xc7\x088\x85\x0cy1\xaf\x0f" + + "c\x04\xb0y\xa4\xacH*,\x19\xaf\xe6\xd4\xa1\x8c\xb4" + + "\x05\x13\x8e\xa4\x01b\x02P3\x90j\x09\xb0\x86\x09\x87" + + "\xb7&\x9aS\x0c*\x00\xd2wm!\xf2\xa2\xa1j\x89" + + "\xbem/$\x13\x97\xa5\xd1[+j\xb1\x80\xc5\x81\x9c" + + "Z\xac\x94\x01\x13\xcer1m\x8a\x05\xd3G\xf3\x96\x11" + + "IQ1\xe1\xacb\xaf\x85y\x8b-Z&\xaeH\xf2" + + "hq@J\xa3\x8b\xb4\x98p\xf6\x8d\xafY\xb5T\x03" + + "\x0a\xc7\xd6\x1e'd\x13$\xd4^\xde\xb6\x8f\xc1\xfeZ" + + "U\xea\x81\xe6J\xd5(\xa7\xad\xe3\x1e\x0b$\x03\xf2\x83" + + "\x09g\xe3X6\x97(\xc4\xc6l\xda\x89\xc8\xc3\xafN" + + "Gl\xc6\xa5\xb2*\x17\xdd\x14\xb6\x05\xce\xa0\xb0\xc7-" + + "\xe9A\xda\xa0>\x1f\x90\xc8o\xd8\xf6\xdbB\"\xb6\x82" + + "\xa3x=\xc3\xa4%=\xad\xab\x01\xc4U\x1c\xc5\x1bI" + + "\xd9\x94|N\xb1\xa6(N:g}\xf0\\\x931[" + + "\\\x1c\xc8\xc5\xa9\xc5\x9e\x04n\x01\x10\xa3\x1c\xc5e\x0c" + + "5%#\x8dR\xaaFi3\x7f\xbd\xf0\xc5\xc9\x9b\xdb" + + "\x7f\xec_\x94>c^\xd7\x14J9>\xa8P\xe8\x89" + + "\x9d\x86\xee\xb5t\xbac\x7fD\xa7x\xb2u\xbd\x13\xfb" + + "\xb8,\x15dI\x19B\x04\x86\x08\xd81T\xcc\xe7\xa5" + + "\xb2\xf5\xd1\xbe\x88\x1b\xc2dN\x855;\x8a\xea\xed\xc1" + + "7\xcc\x14V1{\x86\xfa!^\xab:\xad\x88k\xea" + + "\xe0\xeb\x9fii\xcd\x1c\xf7\xb6\xc2\xba\xc3\x98\x09s$" + + "\xba\xca\xaa\x8c\xba\x92F\xed[\xbaH\xe27s\x14\xef" + + "vv\xc1]\x19g?\xd8\xbb@\xeat\x16\xc4\xa7\x93" + + "vM-\x0eK\x8a\x9a\x1b\x06\xacZ\xf2\xfe\x09r\xdf" + + "SQ\x9aU*\x89glV;\xa5\xa7?g\x19'" + + "[\xdb\x81\xc5\xab\x15\xd9\xd6\xff\xe6\\>/+\x9e\xae" + + "\xba\x0a\x11\xf7\xd9&W\x9cv\xfbE\xe8)1Z\xf3" + + "\x12\xa7\x81!\x8f)\xdb\xe36\xda\xa6c\xe6\xe2\xb4\xca" + + "\xba}\xb9\xb38\x93,l\x94u\x92\x06u\x82\xa3\xb8" + + "\x93!rt\xbdk\x93\x0f\xb5\x03\xc3\x80\xbe1\x92#" + + "4gU\x8e\xe2\x83\x0cCyE\xb5H\x11R\xe4\x01" + + "\x9b \xc3\xb91\x1a_\x85\xe6\xdc\xaaF\xa1\x94\x1bT" + + ":\x86\xaa\x9b\x0a\x83\xae\x9c\x96u\xbd\x7f\x93\xf0\xdbk" + + "\x8e,\xce`s`B\xaa\\[\xbc\x17\x0e\x85)\x8b" + + "\xeb8\x8a\xeb\x18\xc6I\xd81\xe1\xfcX1y6T" + + "QT\x87\x85\xf6\x03\xca\x97\x85\xae~q\xa3\xb6\xaen" + + "\xadvv\x7f\\\xadU%\x8ck\xf7\xaf{\xaaN\x9a" + + ":\xff$y\x8b_\xd6\xa3\x8d\xd9t\x87A\xb3E\x9e" + + "T)\xaf\xf0\\\x89\xab\x06\x91\xb8\xec%\xd2=&\x91" + + "\xfa\\u\xe9\xa5\x96\xf7p\x14\xfb\x19\"3:.\x12" + + "\xbb\xfaL\"\xd9\xbc\x0e\x19\x89\xb8\xf9\x1c\x07\x0c\xa9j" + + "\xc9\xa6\x8a]@tu\xd2]\xc7\x86E\x1f\x94\xff\xb7" + + "\xc4\xdbo\xeeOr\xdbL\xa2R\xbb\x12]}&\xe4" + + "\x12Y\xfftsa\xb3\xadc\xc8~\x0f\xban\xcc8" + + "2l\xdd\xd8\xd6i\xde\xd8\xc3P\x93d\xb9\"o\xaa" + + "\xe4\x01%\x8b\x1a\x97'm\xff\x8c\xf2M\xda5\x04\xbe" + + "O\xd2+\xd6\xd3\xfeu\xe4\xeb\xba\xc7,\xc1\x9a\\>" + + "\x94\x97\x15#1#\x8b\xcb\xe8\xc6<\x1b3^\xac\x8e" + + "\xdeh\xbd\xbf\xe9\xc3\x17\xac\x0f\x8b\xaf{\xa7i\xae\xf9" + + "%2l\xe0(~\x85.\x0a\x18\xb7\xa7\x97\xbb\x86\x9a" + + "\xf5\x19\xb7\xf7\xaew\x86\xfaR\xda\xb8\x9f\xff\x1dEe" + + "SE\x96\xac\xed\xf7\xbf\x00\x00\x00\xff\xffvu8\x1b" + +func init() { + schemas.Register(schema_8f4bd412642c9517, + 0x877af4eba6adb0f3, + 0x8adfcabe5ff9daf4, + 0x8f8172e4469c111a, + 0x91ea9bb47f46c346, + 0x947e1828e214e89d, + 0x95794035a80b7da1, + 0x9b0685a785df42e9, + 0x9bce05e1e88ad9da, + 0xa94f085c31a03112, + 0xacf8185a51a9f1b4, + 0xb21a270577932520, + 0xc340ede57616f2e8, + 0xc4c61531dcc4a3eb, + 0xc5ff2e54709776ec, + 0xca1e844241cf650f, + 0xcc65a2a89c24e6a5, + 0xe7279389a6bbe1dc, + 0xe7f7d11a5652e06c, + 0xf0c5156786d72738, + 0xf10fe9b6293ee63f, + 0xf7a6d78ba978beb9, + 0xf9e52567abde1a0c, + 0xfab1a3b4477ab6b3) +} diff --git a/go/proto/sibra.capnp.go b/go/proto/sibra.capnp.go new file mode 100644 index 0000000000..ebd2b68c21 --- /dev/null +++ b/go/proto/sibra.capnp.go @@ -0,0 +1,195 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SibraPCBExt struct{ capnp.Struct } + +// SibraPCBExt_TypeID is the unique identifier for the type SibraPCBExt. +const SibraPCBExt_TypeID = 0xb8fde9b959e9608d + +func NewSibraPCBExt(s *capnp.Segment) (SibraPCBExt, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}) + return SibraPCBExt{st}, err +} + +func NewRootSibraPCBExt(s *capnp.Segment) (SibraPCBExt, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}) + return SibraPCBExt{st}, err +} + +func ReadRootSibraPCBExt(msg *capnp.Message) (SibraPCBExt, error) { + root, err := msg.RootPtr() + return SibraPCBExt{root.Struct()}, err +} + +func (s SibraPCBExt) String() string { + str, _ := text.Marshal(0xb8fde9b959e9608d, s.Struct) + return str +} + +func (s SibraPCBExt) Id() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s SibraPCBExt) HasId() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SibraPCBExt) SetId(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s SibraPCBExt) Info() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s SibraPCBExt) HasInfo() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s SibraPCBExt) SetInfo(v []byte) error { + return s.Struct.SetData(1, v) +} + +func (s SibraPCBExt) Up() bool { + return s.Struct.Bit(0) +} + +func (s SibraPCBExt) SetUp(v bool) { + s.Struct.SetBit(0, v) +} + +func (s SibraPCBExt) Sofs() (capnp.DataList, error) { + p, err := s.Struct.Ptr(2) + return capnp.DataList{List: p.List()}, err +} + +func (s SibraPCBExt) HasSofs() bool { + p, err := s.Struct.Ptr(2) + return p.IsValid() || err != nil +} + +func (s SibraPCBExt) SetSofs(v capnp.DataList) error { + return s.Struct.SetPtr(2, v.List.ToPtr()) +} + +// NewSofs sets the sofs field to a newly +// allocated capnp.DataList, preferring placement in s's segment. +func (s SibraPCBExt) NewSofs(n int32) (capnp.DataList, error) { + l, err := capnp.NewDataList(s.Struct.Segment(), n) + if err != nil { + return capnp.DataList{}, err + } + err = s.Struct.SetPtr(2, l.List.ToPtr()) + return l, err +} + +// SibraPCBExt_List is a list of SibraPCBExt. +type SibraPCBExt_List struct{ capnp.List } + +// NewSibraPCBExt creates a new list of SibraPCBExt. +func NewSibraPCBExt_List(s *capnp.Segment, sz int32) (SibraPCBExt_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 3}, sz) + return SibraPCBExt_List{l}, err +} + +func (s SibraPCBExt_List) At(i int) SibraPCBExt { return SibraPCBExt{s.List.Struct(i)} } + +func (s SibraPCBExt_List) Set(i int, v SibraPCBExt) error { return s.List.SetStruct(i, v.Struct) } + +func (s SibraPCBExt_List) String() string { + str, _ := text.MarshalList(0xb8fde9b959e9608d, s.List) + return str +} + +// SibraPCBExt_Promise is a wrapper for a SibraPCBExt promised by a client call. +type SibraPCBExt_Promise struct{ *capnp.Pipeline } + +func (p SibraPCBExt_Promise) Struct() (SibraPCBExt, error) { + s, err := p.Pipeline.Struct() + return SibraPCBExt{s}, err +} + +type SibraPayload struct{ capnp.Struct } + +// SibraPayload_TypeID is the unique identifier for the type SibraPayload. +const SibraPayload_TypeID = 0xf231c8f55f84c390 + +func NewSibraPayload(s *capnp.Segment) (SibraPayload, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return SibraPayload{st}, err +} + +func NewRootSibraPayload(s *capnp.Segment) (SibraPayload, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}) + return SibraPayload{st}, err +} + +func ReadRootSibraPayload(msg *capnp.Message) (SibraPayload, error) { + root, err := msg.RootPtr() + return SibraPayload{root.Struct()}, err +} + +func (s SibraPayload) String() string { + str, _ := text.Marshal(0xf231c8f55f84c390, s.Struct) + return str +} + +// SibraPayload_List is a list of SibraPayload. +type SibraPayload_List struct{ capnp.List } + +// NewSibraPayload creates a new list of SibraPayload. +func NewSibraPayload_List(s *capnp.Segment, sz int32) (SibraPayload_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz) + return SibraPayload_List{l}, err +} + +func (s SibraPayload_List) At(i int) SibraPayload { return SibraPayload{s.List.Struct(i)} } + +func (s SibraPayload_List) Set(i int, v SibraPayload) error { return s.List.SetStruct(i, v.Struct) } + +func (s SibraPayload_List) String() string { + str, _ := text.MarshalList(0xf231c8f55f84c390, s.List) + return str +} + +// SibraPayload_Promise is a wrapper for a SibraPayload promised by a client call. +type SibraPayload_Promise struct{ *capnp.Pipeline } + +func (p SibraPayload_Promise) Struct() (SibraPayload, error) { + s, err := p.Pipeline.Struct() + return SibraPayload{s}, err +} + +const schema_d7ac72be29310d11 = "x\xdal\x8e\xbfJ\xf3p\x14\x86\xdf\xf7\x9c\xe4\xcb7" + + "4m\x0f\xcd\xe4\x1d\xd4A\xe8\xe0\xe2\xe4\x1f:\xb8\xe5" + + "\x87\x93 \xd8h,\x0d\xd4&4\x0a\xbaw\x15\xbc\x10" + + "wuq\xd0E\xbc\x01/A\xba\x0a\x8e\x12\xf9\x09\x82" + + "\x83\xd3\xe19\xef3<\xdd|S,\xbc\x05\xdc\xff\xf0" + + "_s5Z\xee\xdf/?\xef\xe0Zdc\xf1\xa0\xff" + + "0\xbfyE\xa8\x11`[\x8f\xb6\xeb\xef\xf0\x0dl\xae" + + "\x9f\x16\x87\x1f\xcf\x83wX\xeb\x97\x18D@\xaf\xcf\x97" + + "\xde:#hS\x17G\xf3l\xed8\x93jVm\xec" + + "yHw\xb6\x87\x17gHI\xd7\xd5\x00\x08\x08X\xb6" + + "\x02\xb8\x03\xa5\x9b\x08\x8dL\xe8\x9f'\xab\x80\x1b)\xdd" + + "THI(\x80\x15^\xcc\x95\xae\x12\x9aJB\x05\xec" + + "\xd4\x8b\x13\xa5[\x08\xb5\xc8\x19C\x18\x83\x9db6." + + "\x7f@\xcf+\x12B\x82\x9d\xba\x1c\xd7l\x83\xa9\xf2{" + + "n\x83\x7f\x85f\x97\xd32\xcb\xe1S\xbf\x02\x00\x00\xff" + + "\xff\xbe\x04?(" + +func init() { + schemas.Register(schema_d7ac72be29310d11, + 0xb8fde9b959e9608d, + 0xf231c8f55f84c390) +} diff --git a/go/proto/sig.capnp.go b/go/proto/sig.capnp.go new file mode 100644 index 0000000000..3f53f57636 --- /dev/null +++ b/go/proto/sig.capnp.go @@ -0,0 +1,379 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + strconv "strconv" + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SIGCtrl struct{ capnp.Struct } +type SIGCtrl_Which uint16 + +const ( + SIGCtrl_Which_unset SIGCtrl_Which = 0 + SIGCtrl_Which_pollReq SIGCtrl_Which = 1 + SIGCtrl_Which_pollRep SIGCtrl_Which = 2 +) + +func (w SIGCtrl_Which) String() string { + const s = "unsetpollReqpollRep" + switch w { + case SIGCtrl_Which_unset: + return s[0:5] + case SIGCtrl_Which_pollReq: + return s[5:12] + case SIGCtrl_Which_pollRep: + return s[12:19] + + } + return "SIGCtrl_Which(" + strconv.FormatUint(uint64(w), 10) + ")" +} + +// SIGCtrl_TypeID is the unique identifier for the type SIGCtrl. +const SIGCtrl_TypeID = 0xe15e242973323d08 + +func NewSIGCtrl(s *capnp.Segment) (SIGCtrl, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return SIGCtrl{st}, err +} + +func NewRootSIGCtrl(s *capnp.Segment) (SIGCtrl, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}) + return SIGCtrl{st}, err +} + +func ReadRootSIGCtrl(msg *capnp.Message) (SIGCtrl, error) { + root, err := msg.RootPtr() + return SIGCtrl{root.Struct()}, err +} + +func (s SIGCtrl) String() string { + str, _ := text.Marshal(0xe15e242973323d08, s.Struct) + return str +} + +func (s SIGCtrl) Which() SIGCtrl_Which { + return SIGCtrl_Which(s.Struct.Uint16(8)) +} +func (s SIGCtrl) Id() uint64 { + return s.Struct.Uint64(0) +} + +func (s SIGCtrl) SetId(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s SIGCtrl) SetUnset() { + s.Struct.SetUint16(8, 0) + +} + +func (s SIGCtrl) PollReq() (SIGPoll, error) { + if s.Struct.Uint16(8) != 1 { + panic("Which() != pollReq") + } + p, err := s.Struct.Ptr(0) + return SIGPoll{Struct: p.Struct()}, err +} + +func (s SIGCtrl) HasPollReq() bool { + if s.Struct.Uint16(8) != 1 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SIGCtrl) SetPollReq(v SIGPoll) error { + s.Struct.SetUint16(8, 1) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPollReq sets the pollReq field to a newly +// allocated SIGPoll struct, preferring placement in s's segment. +func (s SIGCtrl) NewPollReq() (SIGPoll, error) { + s.Struct.SetUint16(8, 1) + ss, err := NewSIGPoll(s.Struct.Segment()) + if err != nil { + return SIGPoll{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SIGCtrl) PollRep() (SIGPoll, error) { + if s.Struct.Uint16(8) != 2 { + panic("Which() != pollRep") + } + p, err := s.Struct.Ptr(0) + return SIGPoll{Struct: p.Struct()}, err +} + +func (s SIGCtrl) HasPollRep() bool { + if s.Struct.Uint16(8) != 2 { + return false + } + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SIGCtrl) SetPollRep(v SIGPoll) error { + s.Struct.SetUint16(8, 2) + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewPollRep sets the pollRep field to a newly +// allocated SIGPoll struct, preferring placement in s's segment. +func (s SIGCtrl) NewPollRep() (SIGPoll, error) { + s.Struct.SetUint16(8, 2) + ss, err := NewSIGPoll(s.Struct.Segment()) + if err != nil { + return SIGPoll{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +// SIGCtrl_List is a list of SIGCtrl. +type SIGCtrl_List struct{ capnp.List } + +// NewSIGCtrl creates a new list of SIGCtrl. +func NewSIGCtrl_List(s *capnp.Segment, sz int32) (SIGCtrl_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 1}, sz) + return SIGCtrl_List{l}, err +} + +func (s SIGCtrl_List) At(i int) SIGCtrl { return SIGCtrl{s.List.Struct(i)} } + +func (s SIGCtrl_List) Set(i int, v SIGCtrl) error { return s.List.SetStruct(i, v.Struct) } + +func (s SIGCtrl_List) String() string { + str, _ := text.MarshalList(0xe15e242973323d08, s.List) + return str +} + +// SIGCtrl_Promise is a wrapper for a SIGCtrl promised by a client call. +type SIGCtrl_Promise struct{ *capnp.Pipeline } + +func (p SIGCtrl_Promise) Struct() (SIGCtrl, error) { + s, err := p.Pipeline.Struct() + return SIGCtrl{s}, err +} + +func (p SIGCtrl_Promise) PollReq() SIGPoll_Promise { + return SIGPoll_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +func (p SIGCtrl_Promise) PollRep() SIGPoll_Promise { + return SIGPoll_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type SIGPoll struct{ capnp.Struct } + +// SIGPoll_TypeID is the unique identifier for the type SIGPoll. +const SIGPoll_TypeID = 0x9ad73a0235a46141 + +func NewSIGPoll(s *capnp.Segment) (SIGPoll, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return SIGPoll{st}, err +} + +func NewRootSIGPoll(s *capnp.Segment) (SIGPoll, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return SIGPoll{st}, err +} + +func ReadRootSIGPoll(msg *capnp.Message) (SIGPoll, error) { + root, err := msg.RootPtr() + return SIGPoll{root.Struct()}, err +} + +func (s SIGPoll) String() string { + str, _ := text.Marshal(0x9ad73a0235a46141, s.Struct) + return str +} + +func (s SIGPoll) Addr() (SIGAddr, error) { + p, err := s.Struct.Ptr(0) + return SIGAddr{Struct: p.Struct()}, err +} + +func (s SIGPoll) HasAddr() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SIGPoll) SetAddr(v SIGAddr) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewAddr sets the addr field to a newly +// allocated SIGAddr struct, preferring placement in s's segment. +func (s SIGPoll) NewAddr() (SIGAddr, error) { + ss, err := NewSIGAddr(s.Struct.Segment()) + if err != nil { + return SIGAddr{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SIGPoll) Session() uint8 { + return s.Struct.Uint8(0) +} + +func (s SIGPoll) SetSession(v uint8) { + s.Struct.SetUint8(0, v) +} + +// SIGPoll_List is a list of SIGPoll. +type SIGPoll_List struct{ capnp.List } + +// NewSIGPoll creates a new list of SIGPoll. +func NewSIGPoll_List(s *capnp.Segment, sz int32) (SIGPoll_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return SIGPoll_List{l}, err +} + +func (s SIGPoll_List) At(i int) SIGPoll { return SIGPoll{s.List.Struct(i)} } + +func (s SIGPoll_List) Set(i int, v SIGPoll) error { return s.List.SetStruct(i, v.Struct) } + +func (s SIGPoll_List) String() string { + str, _ := text.MarshalList(0x9ad73a0235a46141, s.List) + return str +} + +// SIGPoll_Promise is a wrapper for a SIGPoll promised by a client call. +type SIGPoll_Promise struct{ *capnp.Pipeline } + +func (p SIGPoll_Promise) Struct() (SIGPoll, error) { + s, err := p.Pipeline.Struct() + return SIGPoll{s}, err +} + +func (p SIGPoll_Promise) Addr() SIGAddr_Promise { + return SIGAddr_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +type SIGAddr struct{ capnp.Struct } + +// SIGAddr_TypeID is the unique identifier for the type SIGAddr. +const SIGAddr_TypeID = 0xddf1fce11d9b0028 + +func NewSIGAddr(s *capnp.Segment) (SIGAddr, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return SIGAddr{st}, err +} + +func NewRootSIGAddr(s *capnp.Segment) (SIGAddr, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return SIGAddr{st}, err +} + +func ReadRootSIGAddr(msg *capnp.Message) (SIGAddr, error) { + root, err := msg.RootPtr() + return SIGAddr{root.Struct()}, err +} + +func (s SIGAddr) String() string { + str, _ := text.Marshal(0xddf1fce11d9b0028, s.Struct) + return str +} + +func (s SIGAddr) Ctrl() (HostInfo, error) { + p, err := s.Struct.Ptr(0) + return HostInfo{Struct: p.Struct()}, err +} + +func (s SIGAddr) HasCtrl() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SIGAddr) SetCtrl(v HostInfo) error { + return s.Struct.SetPtr(0, v.Struct.ToPtr()) +} + +// NewCtrl sets the ctrl field to a newly +// allocated HostInfo struct, preferring placement in s's segment. +func (s SIGAddr) NewCtrl() (HostInfo, error) { + ss, err := NewHostInfo(s.Struct.Segment()) + if err != nil { + return HostInfo{}, err + } + err = s.Struct.SetPtr(0, ss.Struct.ToPtr()) + return ss, err +} + +func (s SIGAddr) EncapPort() uint16 { + return s.Struct.Uint16(0) +} + +func (s SIGAddr) SetEncapPort(v uint16) { + s.Struct.SetUint16(0, v) +} + +// SIGAddr_List is a list of SIGAddr. +type SIGAddr_List struct{ capnp.List } + +// NewSIGAddr creates a new list of SIGAddr. +func NewSIGAddr_List(s *capnp.Segment, sz int32) (SIGAddr_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return SIGAddr_List{l}, err +} + +func (s SIGAddr_List) At(i int) SIGAddr { return SIGAddr{s.List.Struct(i)} } + +func (s SIGAddr_List) Set(i int, v SIGAddr) error { return s.List.SetStruct(i, v.Struct) } + +func (s SIGAddr_List) String() string { + str, _ := text.MarshalList(0xddf1fce11d9b0028, s.List) + return str +} + +// SIGAddr_Promise is a wrapper for a SIGAddr promised by a client call. +type SIGAddr_Promise struct{ *capnp.Pipeline } + +func (p SIGAddr_Promise) Struct() (SIGAddr, error) { + s, err := p.Pipeline.Struct() + return SIGAddr{s}, err +} + +func (p SIGAddr_Promise) Ctrl() HostInfo_Promise { + return HostInfo_Promise{Pipeline: p.Pipeline.GetPipeline(0)} +} + +const schema_8273379c3e06a721 = "x\xda\x8c\x91\xb1\xeb\xd3@\x1c\xc5\xdf\xbbk\x92\xdfO" + + ",Mh\xa7\x82\xa8P\xb1\x15\x15[,jA\xb1\x8a" + + "\x88[\xaf\xae\"\x86&\xd8@L\xd2$\xa5c\xc1?" + + "\xa1n\xea(8\xb9\xf8\x7f88\x88\x93C'gw" + + "\xeb\xc9\x11\xb5C\x1d~\xd3\x17\xbe\xef\xdd}\xee\xdds" + + "?\xdc\x15}\xabA@\x9d\xb6l=\xf6\xdf\x0d\xc5\xe8" + + "\xebk\xa8S\xa4>\xff\xde\xbe\xf3\xf6F\xf1\x12\x16\x1d" + + "\xc0{\xb1\xf1\x96f.V\xe0\xae\xfb\xe6\xcc\xf6\xe7\x8f" + + "o\xff\xf3}\xdax_\xcc\xfc\xbc\x02\xf5\xd1\xedA\xd1" + + "\xeb<\xdd\x9a\x1b\xc5\xde\xf9\x80\x8ed\xad\xd9\xe7\xa6y" + + "\xcb\x1cj\x0e\xf9\x1d\xd4E\xf4\xfc\xea\xcc\xcf\x12f\xa3" + + "\xc7\x8f\x1eN\xd2\x98\xf1\x84TG\xb2\x06\xd4\x08x\xbd" + + "K\x80\xeaH\xaak\x82d\x8bfw\xe5\x1e\xa0\xba\x92" + + "\xea\xba`\xc3\x0f\x82\x9c\xee\xdf\xe7\x81t\xc1u\x11\x16" + + "E\x94&\xb4!h\x1f`\xc6A\xc0\xfc\x04\x98)\xa0" + + ".K\xaa\x9b\x82\x8dY\x99\xc7t\xf5\xb9\x0b\xafV\xd6" + + "\xc5\xf6GT \x1d&3?\x9b\xa49X\xd2\x81\xa0" + + "s\x00\xbb_\xe6U&\xf7\x1f\xcco\x03\xea\x89\xa4\x9a" + + "\x0b\xd6\xa9u\x85\x0b\x07\x80z&\xa9b\xc1\xba\xf8\xa5" + + "[\x14\x80\x17\x99\xac\x81\xa4\xca\x04\xebr\xa7[\x94\xa6" + + "\x19\xb3\x9dK\xaaRPF\x01\x8f!x\x0c\x9e]&" + + "EX\xc2^gi\x1cO\xc3\x05\xdd}\xc1\x7f~\xa6" + + "R\xb2C\xe5w\x00\x00\x00\xff\xfflyx\xa7" + +func init() { + schemas.Register(schema_8273379c3e06a721, + 0x9ad73a0235a46141, + 0xddf1fce11d9b0028, + 0xe15e242973323d08) +} diff --git a/go/proto/sign.capnp.go b/go/proto/sign.capnp.go new file mode 100644 index 0000000000..41f42a21e5 --- /dev/null +++ b/go/proto/sign.capnp.go @@ -0,0 +1,284 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SignedBlob struct{ capnp.Struct } + +// SignedBlob_TypeID is the unique identifier for the type SignedBlob. +const SignedBlob_TypeID = 0x9f32478537fae352 + +func NewSignedBlob(s *capnp.Segment) (SignedBlob, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SignedBlob{st}, err +} + +func NewRootSignedBlob(s *capnp.Segment) (SignedBlob, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return SignedBlob{st}, err +} + +func ReadRootSignedBlob(msg *capnp.Message) (SignedBlob, error) { + root, err := msg.RootPtr() + return SignedBlob{root.Struct()}, err +} + +func (s SignedBlob) String() string { + str, _ := text.Marshal(0x9f32478537fae352, s.Struct) + return str +} + +func (s SignedBlob) Blob() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s SignedBlob) HasBlob() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SignedBlob) SetBlob(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s SignedBlob) Sign() (Sign, error) { + p, err := s.Struct.Ptr(1) + return Sign{Struct: p.Struct()}, err +} + +func (s SignedBlob) HasSign() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s SignedBlob) SetSign(v Sign) error { + return s.Struct.SetPtr(1, v.Struct.ToPtr()) +} + +// NewSign sets the sign field to a newly +// allocated Sign struct, preferring placement in s's segment. +func (s SignedBlob) NewSign() (Sign, error) { + ss, err := NewSign(s.Struct.Segment()) + if err != nil { + return Sign{}, err + } + err = s.Struct.SetPtr(1, ss.Struct.ToPtr()) + return ss, err +} + +// SignedBlob_List is a list of SignedBlob. +type SignedBlob_List struct{ capnp.List } + +// NewSignedBlob creates a new list of SignedBlob. +func NewSignedBlob_List(s *capnp.Segment, sz int32) (SignedBlob_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return SignedBlob_List{l}, err +} + +func (s SignedBlob_List) At(i int) SignedBlob { return SignedBlob{s.List.Struct(i)} } + +func (s SignedBlob_List) Set(i int, v SignedBlob) error { return s.List.SetStruct(i, v.Struct) } + +func (s SignedBlob_List) String() string { + str, _ := text.MarshalList(0x9f32478537fae352, s.List) + return str +} + +// SignedBlob_Promise is a wrapper for a SignedBlob promised by a client call. +type SignedBlob_Promise struct{ *capnp.Pipeline } + +func (p SignedBlob_Promise) Struct() (SignedBlob, error) { + s, err := p.Pipeline.Struct() + return SignedBlob{s}, err +} + +func (p SignedBlob_Promise) Sign() Sign_Promise { + return Sign_Promise{Pipeline: p.Pipeline.GetPipeline(1)} +} + +type Sign struct{ capnp.Struct } + +// Sign_TypeID is the unique identifier for the type Sign. +const Sign_TypeID = 0x844d9464f44e810a + +func NewSign(s *capnp.Segment) (Sign, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return Sign{st}, err +} + +func NewRootSign(s *capnp.Segment) (Sign, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return Sign{st}, err +} + +func ReadRootSign(msg *capnp.Message) (Sign, error) { + root, err := msg.RootPtr() + return Sign{root.Struct()}, err +} + +func (s Sign) String() string { + str, _ := text.Marshal(0x844d9464f44e810a, s.Struct) + return str +} + +func (s Sign) Type() SignType { + return SignType(s.Struct.Uint16(0)) +} + +func (s Sign) SetType(v SignType) { + s.Struct.SetUint16(0, uint16(v)) +} + +func (s Sign) Src() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s Sign) HasSrc() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s Sign) SetSrc(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s Sign) Signature() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return []byte(p.Data()), err +} + +func (s Sign) HasSignature() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s Sign) SetSignature(v []byte) error { + return s.Struct.SetData(1, v) +} + +func (s Sign) Timestamp() uint32 { + return s.Struct.Uint32(4) +} + +func (s Sign) SetTimestamp(v uint32) { + s.Struct.SetUint32(4, v) +} + +// Sign_List is a list of Sign. +type Sign_List struct{ capnp.List } + +// NewSign creates a new list of Sign. +func NewSign_List(s *capnp.Segment, sz int32) (Sign_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}, sz) + return Sign_List{l}, err +} + +func (s Sign_List) At(i int) Sign { return Sign{s.List.Struct(i)} } + +func (s Sign_List) Set(i int, v Sign) error { return s.List.SetStruct(i, v.Struct) } + +func (s Sign_List) String() string { + str, _ := text.MarshalList(0x844d9464f44e810a, s.List) + return str +} + +// Sign_Promise is a wrapper for a Sign promised by a client call. +type Sign_Promise struct{ *capnp.Pipeline } + +func (p Sign_Promise) Struct() (Sign, error) { + s, err := p.Pipeline.Struct() + return Sign{s}, err +} + +type SignType uint16 + +// SignType_TypeID is the unique identifier for the type SignType. +const SignType_TypeID = 0xf6b5bc42e3072fc9 + +// Values of SignType. +const ( + SignType_none SignType = 0 + SignType_ed25519 SignType = 1 +) + +// String returns the enum's constant name. +func (c SignType) String() string { + switch c { + case SignType_none: + return "none" + case SignType_ed25519: + return "ed25519" + + default: + return "" + } +} + +// SignTypeFromString returns the enum value with a name, +// or the zero value if there's no such value. +func SignTypeFromString(c string) SignType { + switch c { + case "none": + return SignType_none + case "ed25519": + return SignType_ed25519 + + default: + return 0 + } +} + +type SignType_List struct{ capnp.List } + +func NewSignType_List(s *capnp.Segment, sz int32) (SignType_List, error) { + l, err := capnp.NewUInt16List(s, sz) + return SignType_List{l.List}, err +} + +func (l SignType_List) At(i int) SignType { + ul := capnp.UInt16List{List: l.List} + return SignType(ul.At(i)) +} + +func (l SignType_List) Set(i int, v SignType) { + ul := capnp.UInt16List{List: l.List} + ul.Set(i, uint16(v)) +} + +const schema_99440334ec0946a0 = "x\xdal\x91?\x8b\x13A\x18\xc6\x9fg&q\x13c" + + "\xd8\x1d6\xbd \x16\x1a\xf0OBB\xd0J\x82(\x16" + + "\x11'ZZ\xb8I\x86d!\xd9l\x92\x15\x09\x08\xa2" + + "\xe87\x10\xc4J\xb1\xb3\xb8\xe2\x0e\xae\xbb/p\x9f#" + + "\xc55W\x1eW\\\xb3\xc7,\x97\x04\x8eT3<\xfc" + + "x\x9f\xdf\xcb\xeb\xfdz&jy\x97\x80\xbe\x95\xbf\x91" + + "\xde\xfc\xfa\xfal\xf0\xb3\xf3\x1d\xbaD\xa6\x7f_\x14O" + + "\x1b\xf2\xf9o\xe4\x85\x03\xa8\xc975\xcb\xde\x130\xed" + + "\xae.Z?^\xd6\xff@\x95\xae\x83\xfe+\x1e\xf8\x9a" + + "\xf6\xd7\xe1'0=~\xe4\xac\xdaG\x87\xe7P%\xb1" + + "eA\xff?\xff\xf9\xfb\x19\xb8\xc7\x16\x98.\xc2a\xf4" + + "\xb0\x1f\xc4\x8c\xe2\xa7o\xc3a\x847\xa4\xf6d\x0e\xc8" + + "\x11PA\x15\xd0\xef%\xf5H\x90\xac\xd0f\xe6\x0e\xa0" + + "?H\xea\xb1\xa0\x12\xacP\x00*\xec\x02z$\xa9\x13" + + "A%Y\xa1\x04\xd4\xcc\x86\xb1\xa4\xfe,\xe8&\xcb\xd8" + + "\xd0\xdd\x9a\x81tAg1\xef\xb3\x0c\xc1\xf2\x95L\x90" + + "|\x9c\x83f\x93%\xe1\xc4,\x92`\x02\xc6,@\xb0" + + "\xb0C\xda\xdc\x1e\xb4\xc7\xd3\x9eU/l\xd4\xef[\xf5" + + "\xbb\x92\xfa\xb1\xa0Z\xbb?\xb0\xe1=I\xdd\x10t{" + + "\xe3io\xdd\xe3\xda\x99\xf4\xb6\xe7\x00\xe9\xed\xa8z\xe7" + + ",c\x93\x15ek\xab\xaa\x05U\xb1\x0d\xb8\xd142" + + "_\xcc\xa0\xdel\xd6\x9e\\\x06\x00\x00\xff\xff6\xcal" + + "\x01" + +func init() { + schemas.Register(schema_99440334ec0946a0, + 0x844d9464f44e810a, + 0x9f32478537fae352, + 0xf6b5bc42e3072fc9) +} diff --git a/go/proto/structs.gen.go b/go/proto/structs.gen.go new file mode 100644 index 0000000000..dbcaa9a109 --- /dev/null +++ b/go/proto/structs.gen.go @@ -0,0 +1,105 @@ +// Code generated by go/proto/structs_gen_go.sh; DO NOT EDIT. + +package proto + +import ( + "zombiezen.com/go/capnproto2" + + "github.com/scionproto/scion/go/lib/common" +) + +// NewRootStruct calls the appropriate NewRoot function corresponding to the capnp proto type ID, +// and returns the inner capnp.Struct that it receives. This allows the helper +// functions in cereal.go to support generic capnp root struct types. +func NewRootStruct(id ProtoIdType, seg *capnp.Segment) (capnp.Struct, error) { + var blank capnp.Struct + switch id { + case ASEntry_TypeID: + v, err := NewRootASEntry(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new ASEntry capnp struct", err) + } + return v.Struct, nil + case CtrlPld_TypeID: + v, err := NewRootCtrlPld(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new CtrlPld capnp struct", err) + } + return v.Struct, nil + case PathSegment_TypeID: + v, err := NewRootPathSegment(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new PathSegment capnp struct", err) + } + return v.Struct, nil + case PathSegmentSignedData_TypeID: + v, err := NewRootPathSegmentSignedData(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new PathSegmentSignedData capnp struct", err) + } + return v.Struct, nil + case RevInfo_TypeID: + v, err := NewRootRevInfo(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new RevInfo capnp struct", err) + } + return v.Struct, nil + case SCIONDMsg_TypeID: + v, err := NewRootSCIONDMsg(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new SCIONDMsg capnp struct", err) + } + return v.Struct, nil + case SignedBlob_TypeID: + v, err := NewRootSignedBlob(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new SignedBlob capnp struct", err) + } + return v.Struct, nil + case SignedCtrlPld_TypeID: + v, err := NewRootSignedCtrlPld(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new SignedCtrlPld capnp struct", err) + } + return v.Struct, nil + case SVCResolutionReply_TypeID: + v, err := NewRootSVCResolutionReply(seg) + if err != nil { + return blank, common.NewBasicError("Error creating new SVCResolutionReply capnp struct", err) + } + return v.Struct, nil + } + return blank, common.NewBasicError( + "Unsupported capnp struct type (i.e. not listed in go/proto/structs_gen_go.sh:ROOTTYPES)", + nil, + "id", id, + ) +} + +func (s ASEntry) GetStruct() capnp.Struct { + return s.Struct +} +func (s CtrlPld) GetStruct() capnp.Struct { + return s.Struct +} +func (s PathSegment) GetStruct() capnp.Struct { + return s.Struct +} +func (s PathSegmentSignedData) GetStruct() capnp.Struct { + return s.Struct +} +func (s RevInfo) GetStruct() capnp.Struct { + return s.Struct +} +func (s SCIONDMsg) GetStruct() capnp.Struct { + return s.Struct +} +func (s SignedBlob) GetStruct() capnp.Struct { + return s.Struct +} +func (s SignedCtrlPld) GetStruct() capnp.Struct { + return s.Struct +} +func (s SVCResolutionReply) GetStruct() capnp.Struct { + return s.Struct +} diff --git a/go/proto/structs_gen_go.sh b/go/proto/structs_gen_go.sh index d02b1779d9..4bde562573 100755 --- a/go/proto/structs_gen_go.sh +++ b/go/proto/structs_gen_go.sh @@ -17,8 +17,8 @@ import ( // and returns the inner capnp.Struct that it receives. This allows the helper // functions in cereal.go to support generic capnp root struct types. func NewRootStruct(id ProtoIdType, seg *capnp.Segment) (capnp.Struct, error) { - var blank capnp.Struct - switch id { + var blank capnp.Struct + switch id { EOF for roottype in $ROOTTYPES diff --git a/go/proto/svc_resolution.capnp.go b/go/proto/svc_resolution.capnp.go new file mode 100644 index 0000000000..a2eb6bc805 --- /dev/null +++ b/go/proto/svc_resolution.capnp.go @@ -0,0 +1,201 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type SVCResolutionReply struct{ capnp.Struct } + +// SVCResolutionReply_TypeID is the unique identifier for the type SVCResolutionReply. +const SVCResolutionReply_TypeID = 0x85b2cdeba075551b + +func NewSVCResolutionReply(s *capnp.Segment) (SVCResolutionReply, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SVCResolutionReply{st}, err +} + +func NewRootSVCResolutionReply(s *capnp.Segment) (SVCResolutionReply, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}) + return SVCResolutionReply{st}, err +} + +func ReadRootSVCResolutionReply(msg *capnp.Message) (SVCResolutionReply, error) { + root, err := msg.RootPtr() + return SVCResolutionReply{root.Struct()}, err +} + +func (s SVCResolutionReply) String() string { + str, _ := text.Marshal(0x85b2cdeba075551b, s.Struct) + return str +} + +func (s SVCResolutionReply) Transports() (Transport_List, error) { + p, err := s.Struct.Ptr(0) + return Transport_List{List: p.List()}, err +} + +func (s SVCResolutionReply) HasTransports() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s SVCResolutionReply) SetTransports(v Transport_List) error { + return s.Struct.SetPtr(0, v.List.ToPtr()) +} + +// NewTransports sets the transports field to a newly +// allocated Transport_List, preferring placement in s's segment. +func (s SVCResolutionReply) NewTransports(n int32) (Transport_List, error) { + l, err := NewTransport_List(s.Struct.Segment(), n) + if err != nil { + return Transport_List{}, err + } + err = s.Struct.SetPtr(0, l.List.ToPtr()) + return l, err +} + +// SVCResolutionReply_List is a list of SVCResolutionReply. +type SVCResolutionReply_List struct{ capnp.List } + +// NewSVCResolutionReply creates a new list of SVCResolutionReply. +func NewSVCResolutionReply_List(s *capnp.Segment, sz int32) (SVCResolutionReply_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz) + return SVCResolutionReply_List{l}, err +} + +func (s SVCResolutionReply_List) At(i int) SVCResolutionReply { + return SVCResolutionReply{s.List.Struct(i)} +} + +func (s SVCResolutionReply_List) Set(i int, v SVCResolutionReply) error { + return s.List.SetStruct(i, v.Struct) +} + +func (s SVCResolutionReply_List) String() string { + str, _ := text.MarshalList(0x85b2cdeba075551b, s.List) + return str +} + +// SVCResolutionReply_Promise is a wrapper for a SVCResolutionReply promised by a client call. +type SVCResolutionReply_Promise struct{ *capnp.Pipeline } + +func (p SVCResolutionReply_Promise) Struct() (SVCResolutionReply, error) { + s, err := p.Pipeline.Struct() + return SVCResolutionReply{s}, err +} + +type Transport struct{ capnp.Struct } + +// Transport_TypeID is the unique identifier for the type Transport. +const Transport_TypeID = 0xdec7fa6a5148fde5 + +func NewTransport(s *capnp.Segment) (Transport, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return Transport{st}, err +} + +func NewRootTransport(s *capnp.Segment) (Transport, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}) + return Transport{st}, err +} + +func ReadRootTransport(msg *capnp.Message) (Transport, error) { + root, err := msg.RootPtr() + return Transport{root.Struct()}, err +} + +func (s Transport) String() string { + str, _ := text.Marshal(0xdec7fa6a5148fde5, s.Struct) + return str +} + +func (s Transport) Key() (string, error) { + p, err := s.Struct.Ptr(0) + return p.Text(), err +} + +func (s Transport) HasKey() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s Transport) KeyBytes() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return p.TextBytes(), err +} + +func (s Transport) SetKey(v string) error { + return s.Struct.SetText(0, v) +} + +func (s Transport) Value() (string, error) { + p, err := s.Struct.Ptr(1) + return p.Text(), err +} + +func (s Transport) HasValue() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s Transport) ValueBytes() ([]byte, error) { + p, err := s.Struct.Ptr(1) + return p.TextBytes(), err +} + +func (s Transport) SetValue(v string) error { + return s.Struct.SetText(1, v) +} + +// Transport_List is a list of Transport. +type Transport_List struct{ capnp.List } + +// NewTransport creates a new list of Transport. +func NewTransport_List(s *capnp.Segment, sz int32) (Transport_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 2}, sz) + return Transport_List{l}, err +} + +func (s Transport_List) At(i int) Transport { return Transport{s.List.Struct(i)} } + +func (s Transport_List) Set(i int, v Transport) error { return s.List.SetStruct(i, v.Struct) } + +func (s Transport_List) String() string { + str, _ := text.MarshalList(0xdec7fa6a5148fde5, s.List) + return str +} + +// Transport_Promise is a wrapper for a Transport promised by a client call. +type Transport_Promise struct{ *capnp.Pipeline } + +func (p Transport_Promise) Struct() (Transport, error) { + s, err := p.Pipeline.Struct() + return Transport{s}, err +} + +const schema_a52f74a5947eb3b7 = "x\xda\x12\x88t`\x12d\xdd\xce\xc0\x10\xc8\xc1\xca\xf6" + + "_:\xb4t\xc1\xeb\xb3\x9bZ\x19\x04E\x19\xffo\xdf" + + "\\7ei\x89\xfeR\x06VFv\x06\x06CG'" + + "F\xc1@v\x06\x06A_{\x06\xc6\xffO\xffz\x04" + + "f\xfd:~\x0fM%\x13HA\xe3/\xc1^\x10\xdd" + + "Y\xce\xc0\xf8\xbf\xb8,9\xbe(\xb58\x9f%\xa7\xb4" + + "$3?O/9\xb1 \xaf\xc0*8\xcc9(\xb5" + + "8\x1f\"\x16\x94Z\x90S\xc9\x10\xc0\xc8\x18\xc8\xc2\xcc" + + "\xc2\xc0\xc0\xc2\xc8\xc0 \xc8\x1b\xc5\xc0\x10\xc8\xc3\xcc\x18" + + "\xa8\xc1\xc4\xf8\xbf\xa4(1\xaf\xb8 \xbf\x88\x81\xb9\xa4" + + "\x98\x91\x8f\x811\x80\x99\x91Q\x00\xe1\x04\x06F\x90 " + + "\xdc&&\x14\x9bB\x8a\x12\xed\xc1\x9aK@\x16p\xc0" + + "-\xd0Tb`\x08Taf\x0c4`b\x14dd" + + "\x14a\x04\x09\xea\x1a10\x04j03\x06\x9a01" + + "\xb2g\xa7V2\xf2001\xf200\xca\x97%\xe6" + + "\x94\xa6\xc2x\x80\x00\x00\x00\xff\xffM\xe7R " + +func init() { + schemas.Register(schema_a52f74a5947eb3b7, + 0x85b2cdeba075551b, + 0xdec7fa6a5148fde5) +} diff --git a/go/proto/zkid.capnp.go b/go/proto/zkid.capnp.go new file mode 100644 index 0000000000..0848fac5d9 --- /dev/null +++ b/go/proto/zkid.capnp.go @@ -0,0 +1,216 @@ +// Code generated by capnpc-go. DO NOT EDIT. + +package proto + +import ( + capnp "zombiezen.com/go/capnproto2" + text "zombiezen.com/go/capnproto2/encoding/text" + schemas "zombiezen.com/go/capnproto2/schemas" +) + +type ZkId struct{ capnp.Struct } + +// ZkId_TypeID is the unique identifier for the type ZkId. +const ZkId_TypeID = 0xfaadb66890d8d665 + +func NewZkId(s *capnp.Segment) (ZkId, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return ZkId{st}, err +} + +func NewRootZkId(s *capnp.Segment) (ZkId, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}) + return ZkId{st}, err +} + +func ReadRootZkId(msg *capnp.Message) (ZkId, error) { + root, err := msg.RootPtr() + return ZkId{root.Struct()}, err +} + +func (s ZkId) String() string { + str, _ := text.Marshal(0xfaadb66890d8d665, s.Struct) + return str +} + +func (s ZkId) Isdas() uint64 { + return s.Struct.Uint64(0) +} + +func (s ZkId) SetIsdas(v uint64) { + s.Struct.SetUint64(0, v) +} + +func (s ZkId) Id() (string, error) { + p, err := s.Struct.Ptr(0) + return p.Text(), err +} + +func (s ZkId) HasId() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s ZkId) IdBytes() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return p.TextBytes(), err +} + +func (s ZkId) SetId(v string) error { + return s.Struct.SetText(0, v) +} + +func (s ZkId) Addrs() (Addr_List, error) { + p, err := s.Struct.Ptr(1) + return Addr_List{List: p.List()}, err +} + +func (s ZkId) HasAddrs() bool { + p, err := s.Struct.Ptr(1) + return p.IsValid() || err != nil +} + +func (s ZkId) SetAddrs(v Addr_List) error { + return s.Struct.SetPtr(1, v.List.ToPtr()) +} + +// NewAddrs sets the addrs field to a newly +// allocated Addr_List, preferring placement in s's segment. +func (s ZkId) NewAddrs(n int32) (Addr_List, error) { + l, err := NewAddr_List(s.Struct.Segment(), n) + if err != nil { + return Addr_List{}, err + } + err = s.Struct.SetPtr(1, l.List.ToPtr()) + return l, err +} + +// ZkId_List is a list of ZkId. +type ZkId_List struct{ capnp.List } + +// NewZkId creates a new list of ZkId. +func NewZkId_List(s *capnp.Segment, sz int32) (ZkId_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 2}, sz) + return ZkId_List{l}, err +} + +func (s ZkId_List) At(i int) ZkId { return ZkId{s.List.Struct(i)} } + +func (s ZkId_List) Set(i int, v ZkId) error { return s.List.SetStruct(i, v.Struct) } + +func (s ZkId_List) String() string { + str, _ := text.MarshalList(0xfaadb66890d8d665, s.List) + return str +} + +// ZkId_Promise is a wrapper for a ZkId promised by a client call. +type ZkId_Promise struct{ *capnp.Pipeline } + +func (p ZkId_Promise) Struct() (ZkId, error) { + s, err := p.Pipeline.Struct() + return ZkId{s}, err +} + +type Addr struct{ capnp.Struct } + +// Addr_TypeID is the unique identifier for the type Addr. +const Addr_TypeID = 0x8982abce7c93c140 + +func NewAddr(s *capnp.Segment) (Addr, error) { + st, err := capnp.NewStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Addr{st}, err +} + +func NewRootAddr(s *capnp.Segment) (Addr, error) { + st, err := capnp.NewRootStruct(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}) + return Addr{st}, err +} + +func ReadRootAddr(msg *capnp.Message) (Addr, error) { + root, err := msg.RootPtr() + return Addr{root.Struct()}, err +} + +func (s Addr) String() string { + str, _ := text.Marshal(0x8982abce7c93c140, s.Struct) + return str +} + +func (s Addr) Type() uint8 { + return s.Struct.Uint8(0) +} + +func (s Addr) SetType(v uint8) { + s.Struct.SetUint8(0, v) +} + +func (s Addr) Addr() ([]byte, error) { + p, err := s.Struct.Ptr(0) + return []byte(p.Data()), err +} + +func (s Addr) HasAddr() bool { + p, err := s.Struct.Ptr(0) + return p.IsValid() || err != nil +} + +func (s Addr) SetAddr(v []byte) error { + return s.Struct.SetData(0, v) +} + +func (s Addr) Port() uint16 { + return s.Struct.Uint16(2) +} + +func (s Addr) SetPort(v uint16) { + s.Struct.SetUint16(2, v) +} + +// Addr_List is a list of Addr. +type Addr_List struct{ capnp.List } + +// NewAddr creates a new list of Addr. +func NewAddr_List(s *capnp.Segment, sz int32) (Addr_List, error) { + l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz) + return Addr_List{l}, err +} + +func (s Addr_List) At(i int) Addr { return Addr{s.List.Struct(i)} } + +func (s Addr_List) Set(i int, v Addr) error { return s.List.SetStruct(i, v.Struct) } + +func (s Addr_List) String() string { + str, _ := text.MarshalList(0x8982abce7c93c140, s.List) + return str +} + +// Addr_Promise is a wrapper for a Addr promised by a client call. +type Addr_Promise struct{ *capnp.Pipeline } + +func (p Addr_Promise) Struct() (Addr, error) { + s, err := p.Pipeline.Struct() + return Addr{s}, err +} + +const schema_c4f0db62ff503b7d = "x\xdal\x901K\xc3P\x14\x85\xcf\xb9\xafI,\xa6" + + "\xa6\x0f:\xb9twp\xe8\xa8K\x0a\x16,(\xe4\x81" + + "\x93[\xf4\x15\x0c\x05\x0dI\x17EA\xb2\xb9\x09\xfe\x0c" + + "\x117\x9d\x05gGQ\xc4\xff\xe0\xec\x12yE(\x84" + + "N\x07>>\xf8.\xb7{\x1d\x8b\xf6\x9e\x01\xb3\xe2\xf9" + + "u\xfcrw\xf9v_\xdd\xc0\xac\x92\xf5\xd5vR\x1f" + + "}\xfd\xbc\xc2c\x00\xe8a\xa5G\xf3}\x04\xeb\xc9\xfb" + + "\xc7\xed\xc9\xd3\xc3o\xd3\x14g|V\xfa{\xbe\xce\xbc" + + "\x98fv\xf38\xcdy\x9ao\x0d\xad-\x90\x90&T" + + "-\xa0E@\x8f6\x00\x13+\x9a=!\xd9\xa3cc" + + "\xc7v\x14M\"\xd4\xc2\x1e\x05\xd0\xfb\x0e\xee*\x9a\x03" + + "a4;\xcf'\xf4!\xf4\xc1(\xb5\xb6`\x07\xc2\x0e" + + "\x18\xe5g\xc5\x8c\x01\x84A\xa3}8\x1d\xdbf{\xb0" + + "\xa4\xbd\xbe\xac=\xf8o[a?+mZ\xb2\x0da" + + "\x1bT\x99e\x08a\x08\xf6\xdd\x1d%\xd7\xc0D\x91\xdd" + + "\xc53A\x07\xff\x02\x00\x00\xff\xff\x92#K\xd7" + +func init() { + schemas.Register(schema_c4f0db62ff503b7d, + 0x8982abce7c93c140, + 0xfaadb66890d8d665) +} diff --git a/scion.sh b/scion.sh index fc158b128b..1f2dfa9b57 100755 --- a/scion.sh +++ b/scion.sh @@ -317,6 +317,13 @@ go_lint() { lint_header "go" local TMPDIR=$(mktemp -d /tmp/scion-lint.XXXXXXX) local LOCAL_DIRS="$(find go/* -maxdepth 0 -type d | grep -v vendor)" + # Find go files to lint, excluding generated code. For linelen and misspell. + find go -type f -iname '*.go' \ + -a '!' -ipath 'go/proto/structs.gen.go' \ + -a '!' -ipath 'go/proto/*.capnp.go' \ + -a '!' -ipath '*mock_*' \ + -a '!' -ipath 'go/lib/pathpol/sequence/*' > $TMPDIR/gofiles.list + lint_step "Building lint tools" bazel build //:lint || return 1 tar -xf bazel-bin/lint.tar -C $TMPDIR || return 1 @@ -332,10 +339,10 @@ go_lint() { out=$($GOSDK/gofmt -d -s $LOCAL_DIRS); if [ -n "$out" ]; then echo "$out"; ret=1; fi lint_step "linelen (lll)" - out=$(find go -type f -iname '*.go' -a '!' -ipath 'go/proto/structs.gen.go' -a '!' -ipath 'go/proto/*.capnp.go' -a '!' -ipath '*mock_*' -a '!' -ipath 'go/lib/pathpol/sequence/*' | $TMPDIR/lll -w 4 -l 100 --files -e '`comment:"|`ini:"|https?:'); + out=$($TMPDIR/lll -w 4 -l 100 --files -e '`comment:"|`ini:"|https?:' < $TMPDIR/gofiles.list); if [ -n "$out" ]; then echo "$out"; ret=1; fi lint_step "misspell" - $TMPDIR/misspell -error $LOCAL_DIRS || ret=1 + xargs -a $TMPDIR/gofiles.list $TMPDIR/misspell -error || ret=1 lint_step "ineffassign" $TMPDIR/ineffassign -exclude ineffassign.json go || ret=1 lint_step "bazel" diff --git a/tools/ci/checkgogen b/tools/ci/checkgogen new file mode 100755 index 0000000000..c3618f7e1f --- /dev/null +++ b/tools/ci/checkgogen @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +./docker.sh exec "set -eo pipefail; ( cp -R go/proto/ /tmp/; make gogen; diff -ur /tmp/proto/ go/proto/ ) |& tee logs/checkgogen.run"