diff --git a/agent/agent_easyjson.go b/agent/agent_easyjson.go index 9b174b9ed3..1cdec68bf6 100644 --- a/agent/agent_easyjson.go +++ b/agent/agent_easyjson.go @@ -1,16 +1,464 @@ -// TEMPORARY AUTOGENERATED FILE: easyjson stub code to make the package -// compilable during generation. +// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package agent +package agent import ( - "github.com/mailru/easyjson/jwriter" - "github.com/mailru/easyjson/jlexer" + json "encoding/json" + easyjson "github.com/mailru/easyjson" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + pod "github.com/skydive-project/skydive/graffiti/pod" + service "github.com/skydive-project/skydive/graffiti/service" + websocket "github.com/skydive-project/skydive/graffiti/websocket" ) -func ( Status ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* Status ) UnmarshalJSON([]byte) error { return nil } -func ( Status ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* Status ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// suppress unused package warning +var ( + _ *json.RawMessage + _ *jlexer.Lexer + _ *jwriter.Writer + _ easyjson.Marshaler +) + +func easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveAgent(in *jlexer.Lexer, out *Status) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Clients": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Clients = make(map[string]websocket.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v1 websocket.ConnStatus + easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in, &v1) + (out.Clients)[key] = v1 + in.WantComma() + } + in.Delim('}') + } + case "Analyzers": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Analyzers = make(map[string]pod.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v2 pod.ConnStatus + easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveGraffitiPod(in, &v2) + (out.Analyzers)[key] = v2 + in.WantComma() + } + in.Delim('}') + } + case "TopologyProbes": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.TopologyProbes = make(map[string]interface{}) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v3 interface{} + if m, ok := v3.(easyjson.Unmarshaler); ok { + m.UnmarshalEasyJSON(in) + } else if m, ok := v3.(json.Unmarshaler); ok { + _ = m.UnmarshalJSON(in.Raw()) + } else { + v3 = in.Interface() + } + (out.TopologyProbes)[key] = v3 + in.WantComma() + } + in.Delim('}') + } + case "FlowProbes": + if in.IsNull() { + in.Skip() + out.FlowProbes = nil + } else { + in.Delim('[') + if out.FlowProbes == nil { + if !in.IsDelim(']') { + out.FlowProbes = make([]string, 0, 4) + } else { + out.FlowProbes = []string{} + } + } else { + out.FlowProbes = (out.FlowProbes)[:0] + } + for !in.IsDelim(']') { + var v4 string + v4 = string(in.String()) + out.FlowProbes = append(out.FlowProbes, v4) + in.WantComma() + } + in.Delim(']') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveAgent(out *jwriter.Writer, in Status) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Clients\":" + out.RawString(prefix[1:]) + if in.Clients == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v5First := true + for v5Name, v5Value := range in.Clients { + if v5First { + v5First = false + } else { + out.RawByte(',') + } + out.String(string(v5Name)) + out.RawByte(':') + easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out, v5Value) + } + out.RawByte('}') + } + } + { + const prefix string = ",\"Analyzers\":" + out.RawString(prefix) + if in.Analyzers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v6First := true + for v6Name, v6Value := range in.Analyzers { + if v6First { + v6First = false + } else { + out.RawByte(',') + } + out.String(string(v6Name)) + out.RawByte(':') + easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveGraffitiPod(out, v6Value) + } + out.RawByte('}') + } + } + { + const prefix string = ",\"TopologyProbes\":" + out.RawString(prefix) + if in.TopologyProbes == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v7First := true + for v7Name, v7Value := range in.TopologyProbes { + if v7First { + v7First = false + } else { + out.RawByte(',') + } + out.String(string(v7Name)) + out.RawByte(':') + if m, ok := v7Value.(easyjson.Marshaler); ok { + m.MarshalEasyJSON(out) + } else if m, ok := v7Value.(json.Marshaler); ok { + out.Raw(m.MarshalJSON()) + } else { + out.Raw(json.Marshal(v7Value)) + } + } + out.RawByte('}') + } + } + { + const prefix string = ",\"FlowProbes\":" + out.RawString(prefix) + if in.FlowProbes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { + out.RawString("null") + } else { + out.RawByte('[') + for v8, v9 := range in.FlowProbes { + if v8 > 0 { + out.RawByte(',') + } + out.String(string(v9)) + } + out.RawByte(']') + } + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Status) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveAgent(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Status) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveAgent(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Status) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveAgent(&r, v) + return r.Error() +} -type EasyJSON_exporter_Status *Status +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Status) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveAgent(l, v) +} +func easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveGraffitiPod(in *jlexer.Lexer, out *pod.ConnStatus) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "IsMaster": + out.IsMaster = bool(in.Bool()) + case "ServiceType": + out.ServiceType = service.Type(in.String()) + case "ClientProtocol": + out.ClientProtocol = websocket.Protocol(in.String()) + case "Addr": + out.Addr = string(in.String()) + case "Port": + out.Port = int(in.Int()) + case "IsConnected": + if in.IsNull() { + in.Skip() + out.State = nil + } else { + if out.State == nil { + out.State = new(websocket.ConnState) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.State).UnmarshalJSON(data)) + } + } + case "ConnectTime": + if data := in.Raw(); in.Ok() { + in.AddError((out.ConnectTime).UnmarshalJSON(data)) + } + case "RemoteHost": + out.RemoteHost = string(in.String()) + case "RemoteServiceType": + out.RemoteServiceType = service.Type(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveGraffitiPod(out *jwriter.Writer, in pod.ConnStatus) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"IsMaster\":" + out.RawString(prefix[1:]) + out.Bool(bool(in.IsMaster)) + } + { + const prefix string = ",\"ServiceType\":" + out.RawString(prefix) + out.String(string(in.ServiceType)) + } + { + const prefix string = ",\"ClientProtocol\":" + out.RawString(prefix) + out.String(string(in.ClientProtocol)) + } + { + const prefix string = ",\"Addr\":" + out.RawString(prefix) + out.String(string(in.Addr)) + } + { + const prefix string = ",\"Port\":" + out.RawString(prefix) + out.Int(int(in.Port)) + } + { + const prefix string = ",\"IsConnected\":" + out.RawString(prefix) + if in.State == nil { + out.RawString("null") + } else { + out.Raw((*in.State).MarshalJSON()) + } + } + { + const prefix string = ",\"ConnectTime\":" + out.RawString(prefix) + out.Raw((in.ConnectTime).MarshalJSON()) + } + if in.RemoteHost != "" { + const prefix string = ",\"RemoteHost\":" + out.RawString(prefix) + out.String(string(in.RemoteHost)) + } + if in.RemoteServiceType != "" { + const prefix string = ",\"RemoteServiceType\":" + out.RawString(prefix) + out.String(string(in.RemoteServiceType)) + } + out.RawByte('}') +} +func easyjsonCb9d4455DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in *jlexer.Lexer, out *websocket.ConnStatus) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ServiceType": + out.ServiceType = service.Type(in.String()) + case "ClientProtocol": + out.ClientProtocol = websocket.Protocol(in.String()) + case "Addr": + out.Addr = string(in.String()) + case "Port": + out.Port = int(in.Int()) + case "IsConnected": + if in.IsNull() { + in.Skip() + out.State = nil + } else { + if out.State == nil { + out.State = new(websocket.ConnState) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.State).UnmarshalJSON(data)) + } + } + case "ConnectTime": + if data := in.Raw(); in.Ok() { + in.AddError((out.ConnectTime).UnmarshalJSON(data)) + } + case "RemoteHost": + out.RemoteHost = string(in.String()) + case "RemoteServiceType": + out.RemoteServiceType = service.Type(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonCb9d4455EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out *jwriter.Writer, in websocket.ConnStatus) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"ServiceType\":" + out.RawString(prefix[1:]) + out.String(string(in.ServiceType)) + } + { + const prefix string = ",\"ClientProtocol\":" + out.RawString(prefix) + out.String(string(in.ClientProtocol)) + } + { + const prefix string = ",\"Addr\":" + out.RawString(prefix) + out.String(string(in.Addr)) + } + { + const prefix string = ",\"Port\":" + out.RawString(prefix) + out.Int(int(in.Port)) + } + { + const prefix string = ",\"IsConnected\":" + out.RawString(prefix) + if in.State == nil { + out.RawString("null") + } else { + out.Raw((*in.State).MarshalJSON()) + } + } + { + const prefix string = ",\"ConnectTime\":" + out.RawString(prefix) + out.Raw((in.ConnectTime).MarshalJSON()) + } + if in.RemoteHost != "" { + const prefix string = ",\"RemoteHost\":" + out.RawString(prefix) + out.String(string(in.RemoteHost)) + } + if in.RemoteServiceType != "" { + const prefix string = ",\"RemoteServiceType\":" + out.RawString(prefix) + out.String(string(in.RemoteServiceType)) + } + out.RawByte('}') +} diff --git a/analyzer/server_easyjson.go b/analyzer/server_easyjson.go index f95ddf1435..e53e5f7363 100644 --- a/analyzer/server_easyjson.go +++ b/analyzer/server_easyjson.go @@ -1,23 +1,544 @@ -// TEMPORARY AUTOGENERATED FILE: easyjson stub code to make the package -// compilable during generation. +// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package analyzer +package analyzer import ( - "github.com/mailru/easyjson/jwriter" - "github.com/mailru/easyjson/jlexer" + json "encoding/json" + easyjson "github.com/mailru/easyjson" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + hub "github.com/skydive-project/skydive/graffiti/hub" + service "github.com/skydive-project/skydive/graffiti/service" + websocket "github.com/skydive-project/skydive/graffiti/websocket" ) -func ( ElectionStatus ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* ElectionStatus ) UnmarshalJSON([]byte) error { return nil } -func ( ElectionStatus ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* ElectionStatus ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// suppress unused package warning +var ( + _ *json.RawMessage + _ *jlexer.Lexer + _ *jwriter.Writer + _ easyjson.Marshaler +) + +func easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveAnalyzer(in *jlexer.Lexer, out *Status) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Agents": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Agents = make(map[string]websocket.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v1 websocket.ConnStatus + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in, &v1) + (out.Agents)[key] = v1 + in.WantComma() + } + in.Delim('}') + } + case "Peers": + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiHub(in, &out.Peers) + case "Publishers": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Publishers = make(map[string]websocket.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v2 websocket.ConnStatus + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in, &v2) + (out.Publishers)[key] = v2 + in.WantComma() + } + in.Delim('}') + } + case "Subscribers": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Subscribers = make(map[string]websocket.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v3 websocket.ConnStatus + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in, &v3) + (out.Subscribers)[key] = v3 + in.WantComma() + } + in.Delim('}') + } + case "Alerts": + (out.Alerts).UnmarshalEasyJSON(in) + case "Captures": + (out.Captures).UnmarshalEasyJSON(in) + case "Probes": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Probes = make(map[string]interface{}) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v4 interface{} + if m, ok := v4.(easyjson.Unmarshaler); ok { + m.UnmarshalEasyJSON(in) + } else if m, ok := v4.(json.Unmarshaler); ok { + _ = m.UnmarshalJSON(in.Raw()) + } else { + v4 = in.Interface() + } + (out.Probes)[key] = v4 + in.WantComma() + } + in.Delim('}') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveAnalyzer(out *jwriter.Writer, in Status) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Agents\":" + out.RawString(prefix[1:]) + if in.Agents == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v5First := true + for v5Name, v5Value := range in.Agents { + if v5First { + v5First = false + } else { + out.RawByte(',') + } + out.String(string(v5Name)) + out.RawByte(':') + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out, v5Value) + } + out.RawByte('}') + } + } + { + const prefix string = ",\"Peers\":" + out.RawString(prefix) + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiHub(out, in.Peers) + } + { + const prefix string = ",\"Publishers\":" + out.RawString(prefix) + if in.Publishers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v6First := true + for v6Name, v6Value := range in.Publishers { + if v6First { + v6First = false + } else { + out.RawByte(',') + } + out.String(string(v6Name)) + out.RawByte(':') + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out, v6Value) + } + out.RawByte('}') + } + } + { + const prefix string = ",\"Subscribers\":" + out.RawString(prefix) + if in.Subscribers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v7First := true + for v7Name, v7Value := range in.Subscribers { + if v7First { + v7First = false + } else { + out.RawByte(',') + } + out.String(string(v7Name)) + out.RawByte(':') + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out, v7Value) + } + out.RawByte('}') + } + } + { + const prefix string = ",\"Alerts\":" + out.RawString(prefix) + (in.Alerts).MarshalEasyJSON(out) + } + { + const prefix string = ",\"Captures\":" + out.RawString(prefix) + (in.Captures).MarshalEasyJSON(out) + } + { + const prefix string = ",\"Probes\":" + out.RawString(prefix) + if in.Probes == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v8First := true + for v8Name, v8Value := range in.Probes { + if v8First { + v8First = false + } else { + out.RawByte(',') + } + out.String(string(v8Name)) + out.RawByte(':') + if m, ok := v8Value.(easyjson.Marshaler); ok { + m.MarshalEasyJSON(out) + } else if m, ok := v8Value.(json.Marshaler); ok { + out.Raw(m.MarshalJSON()) + } else { + out.Raw(json.Marshal(v8Value)) + } + } + out.RawByte('}') + } + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Status) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveAnalyzer(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Status) MarshalEasyJSON(w *jwriter.Writer) { + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveAnalyzer(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Status) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveAnalyzer(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Status) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveAnalyzer(l, v) +} +func easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiHub(in *jlexer.Lexer, out *hub.PeersStatus) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Incomers": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Incomers = make(map[string]websocket.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v9 websocket.ConnStatus + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in, &v9) + (out.Incomers)[key] = v9 + in.WantComma() + } + in.Delim('}') + } + case "Outgoers": + if in.IsNull() { + in.Skip() + } else { + in.Delim('{') + out.Outgoers = make(map[string]websocket.ConnStatus) + for !in.IsDelim('}') { + key := string(in.String()) + in.WantColon() + var v10 websocket.ConnStatus + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in, &v10) + (out.Outgoers)[key] = v10 + in.WantComma() + } + in.Delim('}') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiHub(out *jwriter.Writer, in hub.PeersStatus) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Incomers\":" + out.RawString(prefix[1:]) + if in.Incomers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v11First := true + for v11Name, v11Value := range in.Incomers { + if v11First { + v11First = false + } else { + out.RawByte(',') + } + out.String(string(v11Name)) + out.RawByte(':') + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out, v11Value) + } + out.RawByte('}') + } + } + { + const prefix string = ",\"Outgoers\":" + out.RawString(prefix) + if in.Outgoers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 { + out.RawString(`null`) + } else { + out.RawByte('{') + v12First := true + for v12Name, v12Value := range in.Outgoers { + if v12First { + v12First = false + } else { + out.RawByte(',') + } + out.String(string(v12Name)) + out.RawByte(':') + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out, v12Value) + } + out.RawByte('}') + } + } + out.RawByte('}') +} +func easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(in *jlexer.Lexer, out *websocket.ConnStatus) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ServiceType": + out.ServiceType = service.Type(in.String()) + case "ClientProtocol": + out.ClientProtocol = websocket.Protocol(in.String()) + case "Addr": + out.Addr = string(in.String()) + case "Port": + out.Port = int(in.Int()) + case "IsConnected": + if in.IsNull() { + in.Skip() + out.State = nil + } else { + if out.State == nil { + out.State = new(websocket.ConnState) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.State).UnmarshalJSON(data)) + } + } + case "ConnectTime": + if data := in.Raw(); in.Ok() { + in.AddError((out.ConnectTime).UnmarshalJSON(data)) + } + case "RemoteHost": + out.RemoteHost = string(in.String()) + case "RemoteServiceType": + out.RemoteServiceType = service.Type(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveGraffitiWebsocket(out *jwriter.Writer, in websocket.ConnStatus) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"ServiceType\":" + out.RawString(prefix[1:]) + out.String(string(in.ServiceType)) + } + { + const prefix string = ",\"ClientProtocol\":" + out.RawString(prefix) + out.String(string(in.ClientProtocol)) + } + { + const prefix string = ",\"Addr\":" + out.RawString(prefix) + out.String(string(in.Addr)) + } + { + const prefix string = ",\"Port\":" + out.RawString(prefix) + out.Int(int(in.Port)) + } + { + const prefix string = ",\"IsConnected\":" + out.RawString(prefix) + if in.State == nil { + out.RawString("null") + } else { + out.Raw((*in.State).MarshalJSON()) + } + } + { + const prefix string = ",\"ConnectTime\":" + out.RawString(prefix) + out.Raw((in.ConnectTime).MarshalJSON()) + } + if in.RemoteHost != "" { + const prefix string = ",\"RemoteHost\":" + out.RawString(prefix) + out.String(string(in.RemoteHost)) + } + if in.RemoteServiceType != "" { + const prefix string = ",\"RemoteServiceType\":" + out.RawString(prefix) + out.String(string(in.RemoteServiceType)) + } + out.RawByte('}') +} +func easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveAnalyzer1(in *jlexer.Lexer, out *ElectionStatus) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "IsMaster": + out.IsMaster = bool(in.Bool()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveAnalyzer1(out *jwriter.Writer, in ElectionStatus) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"IsMaster\":" + out.RawString(prefix[1:]) + out.Bool(bool(in.IsMaster)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v ElectionStatus) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveAnalyzer1(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_ElectionStatus *ElectionStatus +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v ElectionStatus) MarshalEasyJSON(w *jwriter.Writer) { + easyjson22b57fa5EncodeGithubComSkydiveProjectSkydiveAnalyzer1(w, v) +} -func ( Status ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* Status ) UnmarshalJSON([]byte) error { return nil } -func ( Status ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* Status ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *ElectionStatus) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveAnalyzer1(&r, v) + return r.Error() +} -type EasyJSON_exporter_Status *Status +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *ElectionStatus) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson22b57fa5DecodeGithubComSkydiveProjectSkydiveAnalyzer1(l, v) +} diff --git a/coverage.sh b/coverage.sh index c8b3451b68..483d191560 100755 --- a/coverage.sh +++ b/coverage.sh @@ -42,7 +42,7 @@ generate_cover_data() { if [ "$scale" -eq 1 ]; then # scale test export SKYDIVE_ANALYZERS=localhost:8082 - export ELASTICSEARCH=localhost:9200 + export ELASTICSEARCH=localhost:9201 export TLS=true coverfile="../$workdir/scale.cover" export SKYDIVE="${GOPATH}/src/github.com/skydive-project/skydive/scripts/skydive_coverage.sh" diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 0d65f44ee0..7f2c8c11e8 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -67,8 +67,7 @@ if [ "x$PUBLIC_INTERFACE" != "x" ]; then SKYDIVE_PUBLIC_INTERFACES=${SKYDIVE_PUBLIC_INTERFACES:-$LOCAL_HOSTNAME/$PUBLIC_INTERFACE} fi -ELASTICSEARCH_BASE_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution -ELASTICSEARCH_VERSION=5.6.14 +ELASTICSEARCH_VERSION=7.8.0 USE_ELASTICSEARCH=0 if [ "${SKYDIVE_FLOWS_STORAGE}" == "elasticsearch" ] || [ "${SKYDIVE_GRAPH_STORAGE}" == "elasticsearch" ]; then @@ -107,10 +106,10 @@ function install_go { function download_elasticsearch { if [ ! -f ${TOP_DIR}/files/elasticsearch-${ELASTICSEARCH_VERSION}.* ]; then if is_ubuntu; then - wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.deb \ + wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-amd64.deb \ -O ${TOP_DIR}/files/elasticsearch-${ELASTICSEARCH_VERSION}.deb elif is_fedora; then - wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.rpm \ + wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}-x86_64.rpm \ -O ${TOP_DIR}/files/elasticsearch-${ELASTICSEARCH_VERSION}.noarch.rpm fi fi diff --git a/flow/flow.pb_easyjson.go b/flow/flow.pb_easyjson.go index ee318e3395..afb52b2f6d 100644 --- a/flow/flow.pb_easyjson.go +++ b/flow/flow.pb_easyjson.go @@ -1,107 +1,4194 @@ -// TEMPORARY AUTOGENERATED FILE: easyjson stub code to make the package -// compilable during generation. +// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. -package flow +package flow import ( - "github.com/mailru/easyjson/jwriter" - "github.com/mailru/easyjson/jlexer" + json "encoding/json" + layers "github.com/google/gopacket/layers" + easyjson "github.com/mailru/easyjson" + jlexer "github.com/mailru/easyjson/jlexer" + jwriter "github.com/mailru/easyjson/jwriter" + layers1 "github.com/skydive-project/skydive/flow/layers" + filters "github.com/skydive-project/skydive/graffiti/filters" ) -func ( Flow ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* Flow ) UnmarshalJSON([]byte) error { return nil } -func ( Flow ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* Flow ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// suppress unused package warning +var ( + _ *json.RawMessage + _ *jlexer.Lexer + _ *jwriter.Writer + _ easyjson.Marshaler +) + +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow(in *jlexer.Lexer, out *TransportLayer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Protocol": + if data := in.Raw(); in.Ok() { + in.AddError((out.Protocol).UnmarshalJSON(data)) + } + case "A": + out.A = int64(in.Int64()) + case "B": + out.B = int64(in.Int64()) + case "ID": + out.ID = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow(out *jwriter.Writer, in TransportLayer) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Protocol\":" + out.RawString(prefix[1:]) + out.Raw((in.Protocol).MarshalJSON()) + } + { + const prefix string = ",\"A\":" + out.RawString(prefix) + out.Int64(int64(in.A)) + } + { + const prefix string = ",\"B\":" + out.RawString(prefix) + out.Int64(int64(in.B)) + } + { + const prefix string = ",\"ID\":" + out.RawString(prefix) + out.Int64(int64(in.ID)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v TransportLayer) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v TransportLayer) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *TransportLayer) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *TransportLayer) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow1(in *jlexer.Lexer, out *TableReply) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Status": + out.Status = int32(in.Int32()) + case "FlowSetBytes": + if in.IsNull() { + in.Skip() + out.FlowSetBytes = nil + } else { + in.Delim('[') + if out.FlowSetBytes == nil { + if !in.IsDelim(']') { + out.FlowSetBytes = make([][]uint8, 0, 2) + } else { + out.FlowSetBytes = [][]uint8{} + } + } else { + out.FlowSetBytes = (out.FlowSetBytes)[:0] + } + for !in.IsDelim(']') { + var v1 []uint8 + if in.IsNull() { + in.Skip() + v1 = nil + } else { + v1 = in.Bytes() + } + out.FlowSetBytes = append(out.FlowSetBytes, v1) + in.WantComma() + } + in.Delim(']') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow1(out *jwriter.Writer, in TableReply) { + out.RawByte('{') + first := true + _ = first + if in.Status != 0 { + const prefix string = ",\"Status\":" + first = false + out.RawString(prefix[1:]) + out.Int32(int32(in.Status)) + } + if len(in.FlowSetBytes) != 0 { + const prefix string = ",\"FlowSetBytes\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v3, v4 := range in.FlowSetBytes { + if v3 > 0 { + out.RawByte(',') + } + out.Base64Bytes(v4) + } + out.RawByte(']') + } + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v TableReply) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow1(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v TableReply) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow1(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *TableReply) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow1(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *TableReply) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow1(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow2(in *jlexer.Lexer, out *TableQuery) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Type": + out.Type = string(in.String()) + case "query": + if in.IsNull() { + in.Skip() + out.Query = nil + } else { + if out.Query == nil { + out.Query = new(filters.SearchQuery) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters(in, out.Query) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow2(out *jwriter.Writer, in TableQuery) { + out.RawByte('{') + first := true + _ = first + if in.Type != "" { + const prefix string = ",\"Type\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Type)) + } + if in.Query != nil { + const prefix string = ",\"query\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters(out, *in.Query) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v TableQuery) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow2(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v TableQuery) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow2(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *TableQuery) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow2(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *TableQuery) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow2(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters(in *jlexer.Lexer, out *filters.SearchQuery) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Filter": + if in.IsNull() { + in.Skip() + out.Filter = nil + } else { + if out.Filter == nil { + out.Filter = new(filters.Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters1(in, out.Filter) + } + case "PaginationRange": + if in.IsNull() { + in.Skip() + out.PaginationRange = nil + } else { + if out.PaginationRange == nil { + out.PaginationRange = new(filters.Range) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters2(in, out.PaginationRange) + } + case "Sort": + out.Sort = bool(in.Bool()) + case "Dedup": + out.Dedup = bool(in.Bool()) + case "DedupBy": + out.DedupBy = string(in.String()) + case "SortBy": + out.SortBy = string(in.String()) + case "SortOrder": + out.SortOrder = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters(out *jwriter.Writer, in filters.SearchQuery) { + out.RawByte('{') + first := true + _ = first + if in.Filter != nil { + const prefix string = ",\"Filter\":" + first = false + out.RawString(prefix[1:]) + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters1(out, *in.Filter) + } + if in.PaginationRange != nil { + const prefix string = ",\"PaginationRange\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters2(out, *in.PaginationRange) + } + if in.Sort { + const prefix string = ",\"Sort\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.Sort)) + } + if in.Dedup { + const prefix string = ",\"Dedup\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.Dedup)) + } + if in.DedupBy != "" { + const prefix string = ",\"DedupBy\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.DedupBy)) + } + if in.SortBy != "" { + const prefix string = ",\"SortBy\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.SortBy)) + } + if in.SortOrder != "" { + const prefix string = ",\"SortOrder\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.SortOrder)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters2(in *jlexer.Lexer, out *filters.Range) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "From": + out.From = int64(in.Int64()) + case "To": + out.To = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters2(out *jwriter.Writer, in filters.Range) { + out.RawByte('{') + first := true + _ = first + if in.From != 0 { + const prefix string = ",\"From\":" + first = false + out.RawString(prefix[1:]) + out.Int64(int64(in.From)) + } + if in.To != 0 { + const prefix string = ",\"To\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.To)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters1(in *jlexer.Lexer, out *filters.Filter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "TermStringFilter": + if in.IsNull() { + in.Skip() + out.TermStringFilter = nil + } else { + if out.TermStringFilter == nil { + out.TermStringFilter = new(filters.TermStringFilter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters3(in, out.TermStringFilter) + } + case "TermInt64Filter": + if in.IsNull() { + in.Skip() + out.TermInt64Filter = nil + } else { + if out.TermInt64Filter == nil { + out.TermInt64Filter = new(filters.TermInt64Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters4(in, out.TermInt64Filter) + } + case "TermBoolFilter": + if in.IsNull() { + in.Skip() + out.TermBoolFilter = nil + } else { + if out.TermBoolFilter == nil { + out.TermBoolFilter = new(filters.TermBoolFilter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters5(in, out.TermBoolFilter) + } + case "GtInt64Filter": + if in.IsNull() { + in.Skip() + out.GtInt64Filter = nil + } else { + if out.GtInt64Filter == nil { + out.GtInt64Filter = new(filters.GtInt64Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters6(in, out.GtInt64Filter) + } + case "LtInt64Filter": + if in.IsNull() { + in.Skip() + out.LtInt64Filter = nil + } else { + if out.LtInt64Filter == nil { + out.LtInt64Filter = new(filters.LtInt64Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters7(in, out.LtInt64Filter) + } + case "GteInt64Filter": + if in.IsNull() { + in.Skip() + out.GteInt64Filter = nil + } else { + if out.GteInt64Filter == nil { + out.GteInt64Filter = new(filters.GteInt64Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters8(in, out.GteInt64Filter) + } + case "LteInt64Filter": + if in.IsNull() { + in.Skip() + out.LteInt64Filter = nil + } else { + if out.LteInt64Filter == nil { + out.LteInt64Filter = new(filters.LteInt64Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters9(in, out.LteInt64Filter) + } + case "BoolFilter": + if in.IsNull() { + in.Skip() + out.BoolFilter = nil + } else { + if out.BoolFilter == nil { + out.BoolFilter = new(filters.BoolFilter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters10(in, out.BoolFilter) + } + case "RegexFilter": + if in.IsNull() { + in.Skip() + out.RegexFilter = nil + } else { + if out.RegexFilter == nil { + out.RegexFilter = new(filters.RegexFilter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters11(in, out.RegexFilter) + } + case "NullFilter": + if in.IsNull() { + in.Skip() + out.NullFilter = nil + } else { + if out.NullFilter == nil { + out.NullFilter = new(filters.NullFilter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters12(in, out.NullFilter) + } + case "IPV4RangeFilter": + if in.IsNull() { + in.Skip() + out.IPV4RangeFilter = nil + } else { + if out.IPV4RangeFilter == nil { + out.IPV4RangeFilter = new(filters.IPV4RangeFilter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters13(in, out.IPV4RangeFilter) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters1(out *jwriter.Writer, in filters.Filter) { + out.RawByte('{') + first := true + _ = first + if in.TermStringFilter != nil { + const prefix string = ",\"TermStringFilter\":" + first = false + out.RawString(prefix[1:]) + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters3(out, *in.TermStringFilter) + } + if in.TermInt64Filter != nil { + const prefix string = ",\"TermInt64Filter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters4(out, *in.TermInt64Filter) + } + if in.TermBoolFilter != nil { + const prefix string = ",\"TermBoolFilter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters5(out, *in.TermBoolFilter) + } + if in.GtInt64Filter != nil { + const prefix string = ",\"GtInt64Filter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters6(out, *in.GtInt64Filter) + } + if in.LtInt64Filter != nil { + const prefix string = ",\"LtInt64Filter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters7(out, *in.LtInt64Filter) + } + if in.GteInt64Filter != nil { + const prefix string = ",\"GteInt64Filter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters8(out, *in.GteInt64Filter) + } + if in.LteInt64Filter != nil { + const prefix string = ",\"LteInt64Filter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters9(out, *in.LteInt64Filter) + } + if in.BoolFilter != nil { + const prefix string = ",\"BoolFilter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters10(out, *in.BoolFilter) + } + if in.RegexFilter != nil { + const prefix string = ",\"RegexFilter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters11(out, *in.RegexFilter) + } + if in.NullFilter != nil { + const prefix string = ",\"NullFilter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters12(out, *in.NullFilter) + } + if in.IPV4RangeFilter != nil { + const prefix string = ",\"IPV4RangeFilter\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters13(out, *in.IPV4RangeFilter) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters13(in *jlexer.Lexer, out *filters.IPV4RangeFilter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters13(out *jwriter.Writer, in filters.IPV4RangeFilter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != "" { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters12(in *jlexer.Lexer, out *filters.NullFilter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters12(out *jwriter.Writer, in filters.NullFilter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters11(in *jlexer.Lexer, out *filters.RegexFilter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters11(out *jwriter.Writer, in filters.RegexFilter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != "" { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters10(in *jlexer.Lexer, out *filters.BoolFilter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Op": + out.Op = filters.BoolFilterOp(in.Int32()) + case "Filters": + if in.IsNull() { + in.Skip() + out.Filters = nil + } else { + in.Delim('[') + if out.Filters == nil { + if !in.IsDelim(']') { + out.Filters = make([]*filters.Filter, 0, 8) + } else { + out.Filters = []*filters.Filter{} + } + } else { + out.Filters = (out.Filters)[:0] + } + for !in.IsDelim(']') { + var v7 *filters.Filter + if in.IsNull() { + in.Skip() + v7 = nil + } else { + if v7 == nil { + v7 = new(filters.Filter) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters1(in, v7) + } + out.Filters = append(out.Filters, v7) + in.WantComma() + } + in.Delim(']') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters10(out *jwriter.Writer, in filters.BoolFilter) { + out.RawByte('{') + first := true + _ = first + if in.Op != 0 { + const prefix string = ",\"Op\":" + first = false + out.RawString(prefix[1:]) + out.Int32(int32(in.Op)) + } + if len(in.Filters) != 0 { + const prefix string = ",\"Filters\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v8, v9 := range in.Filters { + if v8 > 0 { + out.RawByte(',') + } + if v9 == nil { + out.RawString("null") + } else { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters1(out, *v9) + } + } + out.RawByte(']') + } + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters9(in *jlexer.Lexer, out *filters.LteInt64Filter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters9(out *jwriter.Writer, in filters.LteInt64Filter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != 0 { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters8(in *jlexer.Lexer, out *filters.GteInt64Filter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters8(out *jwriter.Writer, in filters.GteInt64Filter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != 0 { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters7(in *jlexer.Lexer, out *filters.LtInt64Filter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters7(out *jwriter.Writer, in filters.LtInt64Filter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != 0 { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters6(in *jlexer.Lexer, out *filters.GtInt64Filter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters6(out *jwriter.Writer, in filters.GtInt64Filter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != 0 { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters5(in *jlexer.Lexer, out *filters.TermBoolFilter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = bool(in.Bool()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters5(out *jwriter.Writer, in filters.TermBoolFilter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters4(in *jlexer.Lexer, out *filters.TermInt64Filter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters4(out *jwriter.Writer, in filters.TermInt64Filter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != 0 { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveGraffitiFilters3(in *jlexer.Lexer, out *filters.TermStringFilter) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Key": + out.Key = string(in.String()) + case "Value": + out.Value = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveGraffitiFilters3(out *jwriter.Writer, in filters.TermStringFilter) { + out.RawByte('{') + first := true + _ = first + if in.Key != "" { + const prefix string = ",\"Key\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Key)) + } + if in.Value != "" { + const prefix string = ",\"Value\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Value)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow3(in *jlexer.Lexer, out *TCPMetric) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ABSynStart": + out.ABSynStart = int64(in.Int64()) + case "BASynStart": + out.BASynStart = int64(in.Int64()) + case "ABSynTTL": + out.ABSynTTL = uint32(in.Uint32()) + case "BASynTTL": + out.BASynTTL = uint32(in.Uint32()) + case "ABFinStart": + out.ABFinStart = int64(in.Int64()) + case "BAFinStart": + out.BAFinStart = int64(in.Int64()) + case "ABRstStart": + out.ABRstStart = int64(in.Int64()) + case "BARstStart": + out.BARstStart = int64(in.Int64()) + case "ABSegmentOutOfOrder": + out.ABSegmentOutOfOrder = int64(in.Int64()) + case "ABSegmentSkipped": + out.ABSegmentSkipped = int64(in.Int64()) + case "ABSegmentSkippedBytes": + out.ABSegmentSkippedBytes = int64(in.Int64()) + case "ABPackets": + out.ABPackets = int64(in.Int64()) + case "ABBytes": + out.ABBytes = int64(in.Int64()) + case "ABSawStart": + out.ABSawStart = int64(in.Int64()) + case "ABSawEnd": + out.ABSawEnd = int64(in.Int64()) + case "BASegmentOutOfOrder": + out.BASegmentOutOfOrder = int64(in.Int64()) + case "BASegmentSkipped": + out.BASegmentSkipped = int64(in.Int64()) + case "BASegmentSkippedBytes": + out.BASegmentSkippedBytes = int64(in.Int64()) + case "BAPackets": + out.BAPackets = int64(in.Int64()) + case "BABytes": + out.BABytes = int64(in.Int64()) + case "BASawStart": + out.BASawStart = int64(in.Int64()) + case "BASawEnd": + out.BASawEnd = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow3(out *jwriter.Writer, in TCPMetric) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"ABSynStart\":" + out.RawString(prefix[1:]) + out.Int64(int64(in.ABSynStart)) + } + { + const prefix string = ",\"BASynStart\":" + out.RawString(prefix) + out.Int64(int64(in.BASynStart)) + } + if in.ABSynTTL != 0 { + const prefix string = ",\"ABSynTTL\":" + out.RawString(prefix) + out.Uint32(uint32(in.ABSynTTL)) + } + if in.BASynTTL != 0 { + const prefix string = ",\"BASynTTL\":" + out.RawString(prefix) + out.Uint32(uint32(in.BASynTTL)) + } + { + const prefix string = ",\"ABFinStart\":" + out.RawString(prefix) + out.Int64(int64(in.ABFinStart)) + } + { + const prefix string = ",\"BAFinStart\":" + out.RawString(prefix) + out.Int64(int64(in.BAFinStart)) + } + { + const prefix string = ",\"ABRstStart\":" + out.RawString(prefix) + out.Int64(int64(in.ABRstStart)) + } + { + const prefix string = ",\"BARstStart\":" + out.RawString(prefix) + out.Int64(int64(in.BARstStart)) + } + { + const prefix string = ",\"ABSegmentOutOfOrder\":" + out.RawString(prefix) + out.Int64(int64(in.ABSegmentOutOfOrder)) + } + { + const prefix string = ",\"ABSegmentSkipped\":" + out.RawString(prefix) + out.Int64(int64(in.ABSegmentSkipped)) + } + { + const prefix string = ",\"ABSegmentSkippedBytes\":" + out.RawString(prefix) + out.Int64(int64(in.ABSegmentSkippedBytes)) + } + { + const prefix string = ",\"ABPackets\":" + out.RawString(prefix) + out.Int64(int64(in.ABPackets)) + } + { + const prefix string = ",\"ABBytes\":" + out.RawString(prefix) + out.Int64(int64(in.ABBytes)) + } + { + const prefix string = ",\"ABSawStart\":" + out.RawString(prefix) + out.Int64(int64(in.ABSawStart)) + } + { + const prefix string = ",\"ABSawEnd\":" + out.RawString(prefix) + out.Int64(int64(in.ABSawEnd)) + } + { + const prefix string = ",\"BASegmentOutOfOrder\":" + out.RawString(prefix) + out.Int64(int64(in.BASegmentOutOfOrder)) + } + { + const prefix string = ",\"BASegmentSkipped\":" + out.RawString(prefix) + out.Int64(int64(in.BASegmentSkipped)) + } + { + const prefix string = ",\"BASegmentSkippedBytes\":" + out.RawString(prefix) + out.Int64(int64(in.BASegmentSkippedBytes)) + } + { + const prefix string = ",\"BAPackets\":" + out.RawString(prefix) + out.Int64(int64(in.BAPackets)) + } + { + const prefix string = ",\"BABytes\":" + out.RawString(prefix) + out.Int64(int64(in.BABytes)) + } + { + const prefix string = ",\"BASawStart\":" + out.RawString(prefix) + out.Int64(int64(in.BASawStart)) + } + { + const prefix string = ",\"BASawEnd\":" + out.RawString(prefix) + out.Int64(int64(in.BASawEnd)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v TCPMetric) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow3(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v TCPMetric) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow3(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *TCPMetric) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow3(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *TCPMetric) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow3(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow4(in *jlexer.Lexer, out *Stats) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "CaptureID": + out.CaptureID = string(in.String()) + case "FlowCount": + out.FlowCount = int64(in.Int64()) + case "FlowDropped": + out.FlowDropped = int64(in.Int64()) + case "KernelFlowDropped": + out.KernelFlowDropped = int64(in.Int64()) + case "PacketsDropped": + out.PacketsDropped = int64(in.Int64()) + case "PacketsReceived": + out.PacketsReceived = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow4(out *jwriter.Writer, in Stats) { + out.RawByte('{') + first := true + _ = first + if in.CaptureID != "" { + const prefix string = ",\"CaptureID\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.CaptureID)) + } + { + const prefix string = ",\"FlowCount\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.FlowCount)) + } + { + const prefix string = ",\"FlowDropped\":" + out.RawString(prefix) + out.Int64(int64(in.FlowDropped)) + } + { + const prefix string = ",\"KernelFlowDropped\":" + out.RawString(prefix) + out.Int64(int64(in.KernelFlowDropped)) + } + { + const prefix string = ",\"PacketsDropped\":" + out.RawString(prefix) + out.Int64(int64(in.PacketsDropped)) + } + { + const prefix string = ",\"PacketsReceived\":" + out.RawString(prefix) + out.Int64(int64(in.PacketsReceived)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Stats) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow4(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Stats) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow4(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Stats) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow4(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Stats) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow4(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow5(in *jlexer.Lexer, out *RawPacket) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Timestamp": + out.Timestamp = int64(in.Int64()) + case "Index": + out.Index = int64(in.Int64()) + case "Data": + if in.IsNull() { + in.Skip() + out.Data = nil + } else { + out.Data = in.Bytes() + } + case "LinkType": + out.LinkType = layers.LinkType(in.Uint8()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow5(out *jwriter.Writer, in RawPacket) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Timestamp\":" + out.RawString(prefix[1:]) + out.Int64(int64(in.Timestamp)) + } + { + const prefix string = ",\"Index\":" + out.RawString(prefix) + out.Int64(int64(in.Index)) + } + if len(in.Data) != 0 { + const prefix string = ",\"Data\":" + out.RawString(prefix) + out.Base64Bytes(in.Data) + } + if in.LinkType != 0 { + const prefix string = ",\"LinkType\":" + out.RawString(prefix) + out.Uint8(uint8(in.LinkType)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v RawPacket) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow5(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v RawPacket) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow5(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *RawPacket) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow5(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *RawPacket) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow5(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow6(in *jlexer.Lexer, out *Message) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Flows": + if in.IsNull() { + in.Skip() + out.Flows = nil + } else { + in.Delim('[') + if out.Flows == nil { + if !in.IsDelim(']') { + out.Flows = make([]*Flow, 0, 8) + } else { + out.Flows = []*Flow{} + } + } else { + out.Flows = (out.Flows)[:0] + } + for !in.IsDelim(']') { + var v13 *Flow + if in.IsNull() { + in.Skip() + v13 = nil + } else { + if v13 == nil { + v13 = new(Flow) + } + (*v13).UnmarshalEasyJSON(in) + } + out.Flows = append(out.Flows, v13) + in.WantComma() + } + in.Delim(']') + } + case "Stats": + if in.IsNull() { + in.Skip() + out.Stats = nil + } else { + if out.Stats == nil { + out.Stats = new(Stats) + } + (*out.Stats).UnmarshalEasyJSON(in) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow6(out *jwriter.Writer, in Message) { + out.RawByte('{') + first := true + _ = first + if len(in.Flows) != 0 { + const prefix string = ",\"Flows\":" + first = false + out.RawString(prefix[1:]) + { + out.RawByte('[') + for v14, v15 := range in.Flows { + if v14 > 0 { + out.RawByte(',') + } + if v15 == nil { + out.RawString("null") + } else { + (*v15).MarshalEasyJSON(out) + } + } + out.RawByte(']') + } + } + if in.Stats != nil { + const prefix string = ",\"Stats\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Stats).MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Message) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow6(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Message) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow6(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Message) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow6(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow6(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow7(in *jlexer.Lexer, out *IPMetric) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Fragments": + out.Fragments = int64(in.Int64()) + case "FragmentErrors": + out.FragmentErrors = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow7(out *jwriter.Writer, in IPMetric) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Fragments\":" + out.RawString(prefix[1:]) + out.Int64(int64(in.Fragments)) + } + { + const prefix string = ",\"FragmentErrors\":" + out.RawString(prefix) + out.Int64(int64(in.FragmentErrors)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v IPMetric) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow7(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_Flow *Flow +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v IPMetric) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow7(w, v) +} -func ( FlowLayer ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* FlowLayer ) UnmarshalJSON([]byte) error { return nil } -func ( FlowLayer ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* FlowLayer ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *IPMetric) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow7(&r, v) + return r.Error() +} -type EasyJSON_exporter_FlowLayer *FlowLayer +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *IPMetric) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow7(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow8(in *jlexer.Lexer, out *ICMPLayer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Type": + if data := in.Raw(); in.Ok() { + in.AddError((out.Type).UnmarshalJSON(data)) + } + case "Code": + out.Code = uint32(in.Uint32()) + case "ID": + out.ID = uint32(in.Uint32()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow8(out *jwriter.Writer, in ICMPLayer) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Type\":" + out.RawString(prefix[1:]) + out.Raw((in.Type).MarshalJSON()) + } + if in.Code != 0 { + const prefix string = ",\"Code\":" + out.RawString(prefix) + out.Uint32(uint32(in.Code)) + } + if in.ID != 0 { + const prefix string = ",\"ID\":" + out.RawString(prefix) + out.Uint32(uint32(in.ID)) + } + out.RawByte('}') +} -func ( FlowMetric ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* FlowMetric ) UnmarshalJSON([]byte) error { return nil } -func ( FlowMetric ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* FlowMetric ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// MarshalJSON supports json.Marshaler interface +func (v ICMPLayer) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow8(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_FlowMetric *FlowMetric +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v ICMPLayer) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow8(w, v) +} -func ( FlowSearchReply ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* FlowSearchReply ) UnmarshalJSON([]byte) error { return nil } -func ( FlowSearchReply ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* FlowSearchReply ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *ICMPLayer) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow8(&r, v) + return r.Error() +} -type EasyJSON_exporter_FlowSearchReply *FlowSearchReply +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *ICMPLayer) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow8(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow9(in *jlexer.Lexer, out *FlowSet) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Flows": + if in.IsNull() { + in.Skip() + out.Flows = nil + } else { + in.Delim('[') + if out.Flows == nil { + if !in.IsDelim(']') { + out.Flows = make([]*Flow, 0, 8) + } else { + out.Flows = []*Flow{} + } + } else { + out.Flows = (out.Flows)[:0] + } + for !in.IsDelim(']') { + var v16 *Flow + if in.IsNull() { + in.Skip() + v16 = nil + } else { + if v16 == nil { + v16 = new(Flow) + } + (*v16).UnmarshalEasyJSON(in) + } + out.Flows = append(out.Flows, v16) + in.WantComma() + } + in.Delim(']') + } + case "Start": + out.Start = int64(in.Int64()) + case "End": + out.End = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow9(out *jwriter.Writer, in FlowSet) { + out.RawByte('{') + first := true + _ = first + if len(in.Flows) != 0 { + const prefix string = ",\"Flows\":" + first = false + out.RawString(prefix[1:]) + { + out.RawByte('[') + for v17, v18 := range in.Flows { + if v17 > 0 { + out.RawByte(',') + } + if v18 == nil { + out.RawString("null") + } else { + (*v18).MarshalEasyJSON(out) + } + } + out.RawByte(']') + } + } + { + const prefix string = ",\"Start\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Start)) + } + { + const prefix string = ",\"End\":" + out.RawString(prefix) + out.Int64(int64(in.End)) + } + out.RawByte('}') +} -func ( FlowSet ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* FlowSet ) UnmarshalJSON([]byte) error { return nil } -func ( FlowSet ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* FlowSet ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// MarshalJSON supports json.Marshaler interface +func (v FlowSet) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow9(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_FlowSet *FlowSet +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v FlowSet) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow9(w, v) +} -func ( ICMPLayer ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* ICMPLayer ) UnmarshalJSON([]byte) error { return nil } -func ( ICMPLayer ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* ICMPLayer ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *FlowSet) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow9(&r, v) + return r.Error() +} -type EasyJSON_exporter_ICMPLayer *ICMPLayer +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *FlowSet) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow9(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow10(in *jlexer.Lexer, out *FlowSearchReply) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "FlowSet": + if in.IsNull() { + in.Skip() + out.FlowSet = nil + } else { + if out.FlowSet == nil { + out.FlowSet = new(FlowSet) + } + (*out.FlowSet).UnmarshalEasyJSON(in) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow10(out *jwriter.Writer, in FlowSearchReply) { + out.RawByte('{') + first := true + _ = first + if in.FlowSet != nil { + const prefix string = ",\"FlowSet\":" + first = false + out.RawString(prefix[1:]) + (*in.FlowSet).MarshalEasyJSON(out) + } + out.RawByte('}') +} -func ( IPMetric ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* IPMetric ) UnmarshalJSON([]byte) error { return nil } -func ( IPMetric ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* IPMetric ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// MarshalJSON supports json.Marshaler interface +func (v FlowSearchReply) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow10(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_IPMetric *IPMetric +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v FlowSearchReply) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow10(w, v) +} -func ( Message ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* Message ) UnmarshalJSON([]byte) error { return nil } -func ( Message ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* Message ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *FlowSearchReply) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow10(&r, v) + return r.Error() +} -type EasyJSON_exporter_Message *Message +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *FlowSearchReply) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow10(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow11(in *jlexer.Lexer, out *FlowMetric) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ABPackets": + out.ABPackets = int64(in.Int64()) + case "ABBytes": + out.ABBytes = int64(in.Int64()) + case "BAPackets": + out.BAPackets = int64(in.Int64()) + case "BABytes": + out.BABytes = int64(in.Int64()) + case "Start": + out.Start = int64(in.Int64()) + case "Last": + out.Last = int64(in.Int64()) + case "RTT": + out.RTT = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow11(out *jwriter.Writer, in FlowMetric) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"ABPackets\":" + out.RawString(prefix[1:]) + out.Int64(int64(in.ABPackets)) + } + { + const prefix string = ",\"ABBytes\":" + out.RawString(prefix) + out.Int64(int64(in.ABBytes)) + } + { + const prefix string = ",\"BAPackets\":" + out.RawString(prefix) + out.Int64(int64(in.BAPackets)) + } + { + const prefix string = ",\"BABytes\":" + out.RawString(prefix) + out.Int64(int64(in.BABytes)) + } + { + const prefix string = ",\"Start\":" + out.RawString(prefix) + out.Int64(int64(in.Start)) + } + { + const prefix string = ",\"Last\":" + out.RawString(prefix) + out.Int64(int64(in.Last)) + } + if in.RTT != 0 { + const prefix string = ",\"RTT\":" + out.RawString(prefix) + out.Int64(int64(in.RTT)) + } + out.RawByte('}') +} -func ( RawPacket ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* RawPacket ) UnmarshalJSON([]byte) error { return nil } -func ( RawPacket ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* RawPacket ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// MarshalJSON supports json.Marshaler interface +func (v FlowMetric) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow11(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_RawPacket *RawPacket +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v FlowMetric) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow11(w, v) +} -func ( Stats ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* Stats ) UnmarshalJSON([]byte) error { return nil } -func ( Stats ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* Stats ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *FlowMetric) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow11(&r, v) + return r.Error() +} -type EasyJSON_exporter_Stats *Stats +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *FlowMetric) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow11(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow12(in *jlexer.Lexer, out *FlowLayer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Protocol": + if data := in.Raw(); in.Ok() { + in.AddError((out.Protocol).UnmarshalJSON(data)) + } + case "A": + out.A = string(in.String()) + case "B": + out.B = string(in.String()) + case "ID": + out.ID = int64(in.Int64()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow12(out *jwriter.Writer, in FlowLayer) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"Protocol\":" + out.RawString(prefix[1:]) + out.Raw((in.Protocol).MarshalJSON()) + } + if in.A != "" { + const prefix string = ",\"A\":" + out.RawString(prefix) + out.String(string(in.A)) + } + if in.B != "" { + const prefix string = ",\"B\":" + out.RawString(prefix) + out.String(string(in.B)) + } + { + const prefix string = ",\"ID\":" + out.RawString(prefix) + out.Int64(int64(in.ID)) + } + out.RawByte('}') +} -func ( TCPMetric ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* TCPMetric ) UnmarshalJSON([]byte) error { return nil } -func ( TCPMetric ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* TCPMetric ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// MarshalJSON supports json.Marshaler interface +func (v FlowLayer) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow12(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_TCPMetric *TCPMetric +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v FlowLayer) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow12(w, v) +} -func ( TableQuery ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* TableQuery ) UnmarshalJSON([]byte) error { return nil } -func ( TableQuery ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* TableQuery ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *FlowLayer) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow12(&r, v) + return r.Error() +} -type EasyJSON_exporter_TableQuery *TableQuery +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *FlowLayer) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow12(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow13(in *jlexer.Lexer, out *Flow) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "UUID": + out.UUID = string(in.String()) + case "LayersPath": + out.LayersPath = string(in.String()) + case "Application": + out.Application = string(in.String()) + case "Link": + if in.IsNull() { + in.Skip() + out.Link = nil + } else { + if out.Link == nil { + out.Link = new(FlowLayer) + } + (*out.Link).UnmarshalEasyJSON(in) + } + case "Network": + if in.IsNull() { + in.Skip() + out.Network = nil + } else { + if out.Network == nil { + out.Network = new(FlowLayer) + } + (*out.Network).UnmarshalEasyJSON(in) + } + case "Transport": + if in.IsNull() { + in.Skip() + out.Transport = nil + } else { + if out.Transport == nil { + out.Transport = new(TransportLayer) + } + (*out.Transport).UnmarshalEasyJSON(in) + } + case "ICMP": + if in.IsNull() { + in.Skip() + out.ICMP = nil + } else { + if out.ICMP == nil { + out.ICMP = new(ICMPLayer) + } + (*out.ICMP).UnmarshalEasyJSON(in) + } + case "DHCPv4": + if in.IsNull() { + in.Skip() + out.DHCPv4 = nil + } else { + if out.DHCPv4 == nil { + out.DHCPv4 = new(layers1.DHCPv4) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers(in, out.DHCPv4) + } + case "DNS": + if in.IsNull() { + in.Skip() + out.DNS = nil + } else { + if out.DNS == nil { + out.DNS = new(layers1.DNS) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers1(in, out.DNS) + } + case "VRRPv2": + if in.IsNull() { + in.Skip() + out.VRRPv2 = nil + } else { + if out.VRRPv2 == nil { + out.VRRPv2 = new(layers1.VRRPv2) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers2(in, out.VRRPv2) + } + case "LastUpdateMetric": + if in.IsNull() { + in.Skip() + out.LastUpdateMetric = nil + } else { + if out.LastUpdateMetric == nil { + out.LastUpdateMetric = new(FlowMetric) + } + (*out.LastUpdateMetric).UnmarshalEasyJSON(in) + } + case "Metric": + if in.IsNull() { + in.Skip() + out.Metric = nil + } else { + if out.Metric == nil { + out.Metric = new(FlowMetric) + } + (*out.Metric).UnmarshalEasyJSON(in) + } + case "TCPMetric": + if in.IsNull() { + in.Skip() + out.TCPMetric = nil + } else { + if out.TCPMetric == nil { + out.TCPMetric = new(TCPMetric) + } + (*out.TCPMetric).UnmarshalEasyJSON(in) + } + case "IPMetric": + if in.IsNull() { + in.Skip() + out.IPMetric = nil + } else { + if out.IPMetric == nil { + out.IPMetric = new(IPMetric) + } + (*out.IPMetric).UnmarshalEasyJSON(in) + } + case "Start": + out.Start = int64(in.Int64()) + case "Last": + out.Last = int64(in.Int64()) + case "TrackingID": + out.TrackingID = string(in.String()) + case "L3TrackingID": + out.L3TrackingID = string(in.String()) + case "ParentUUID": + out.ParentUUID = string(in.String()) + case "NodeTID": + out.NodeTID = string(in.String()) + case "CaptureID": + out.CaptureID = string(in.String()) + case "RawPacketsCaptured": + out.RawPacketsCaptured = int64(in.Int64()) + case "FinishType": + out.FinishType = FlowFinishType(in.Int32()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow13(out *jwriter.Writer, in Flow) { + out.RawByte('{') + first := true + _ = first + if in.UUID != "" { + const prefix string = ",\"UUID\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.UUID)) + } + if in.LayersPath != "" { + const prefix string = ",\"LayersPath\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.LayersPath)) + } + if in.Application != "" { + const prefix string = ",\"Application\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Application)) + } + if in.Link != nil { + const prefix string = ",\"Link\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Link).MarshalEasyJSON(out) + } + if in.Network != nil { + const prefix string = ",\"Network\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Network).MarshalEasyJSON(out) + } + if in.Transport != nil { + const prefix string = ",\"Transport\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Transport).MarshalEasyJSON(out) + } + if in.ICMP != nil { + const prefix string = ",\"ICMP\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.ICMP).MarshalEasyJSON(out) + } + if in.DHCPv4 != nil { + const prefix string = ",\"DHCPv4\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers(out, *in.DHCPv4) + } + if in.DNS != nil { + const prefix string = ",\"DNS\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers1(out, *in.DNS) + } + if in.VRRPv2 != nil { + const prefix string = ",\"VRRPv2\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers2(out, *in.VRRPv2) + } + if in.LastUpdateMetric != nil { + const prefix string = ",\"LastUpdateMetric\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.LastUpdateMetric).MarshalEasyJSON(out) + } + if in.Metric != nil { + const prefix string = ",\"Metric\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Metric).MarshalEasyJSON(out) + } + if in.TCPMetric != nil { + const prefix string = ",\"TCPMetric\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.TCPMetric).MarshalEasyJSON(out) + } + if in.IPMetric != nil { + const prefix string = ",\"IPMetric\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.IPMetric).MarshalEasyJSON(out) + } + { + const prefix string = ",\"Start\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int64(int64(in.Start)) + } + { + const prefix string = ",\"Last\":" + out.RawString(prefix) + out.Int64(int64(in.Last)) + } + if in.TrackingID != "" { + const prefix string = ",\"TrackingID\":" + out.RawString(prefix) + out.String(string(in.TrackingID)) + } + if in.L3TrackingID != "" { + const prefix string = ",\"L3TrackingID\":" + out.RawString(prefix) + out.String(string(in.L3TrackingID)) + } + { + const prefix string = ",\"ParentUUID\":" + out.RawString(prefix) + out.String(string(in.ParentUUID)) + } + if in.NodeTID != "" { + const prefix string = ",\"NodeTID\":" + out.RawString(prefix) + out.String(string(in.NodeTID)) + } + if in.CaptureID != "" { + const prefix string = ",\"CaptureID\":" + out.RawString(prefix) + out.String(string(in.CaptureID)) + } + { + const prefix string = ",\"RawPacketsCaptured\":" + out.RawString(prefix) + out.Int64(int64(in.RawPacketsCaptured)) + } + if in.FinishType != 0 { + const prefix string = ",\"FinishType\":" + out.RawString(prefix) + out.Int32(int32(in.FinishType)) + } + out.RawByte('}') +} -func ( TableReply ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* TableReply ) UnmarshalJSON([]byte) error { return nil } -func ( TableReply ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* TableReply ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// MarshalJSON supports json.Marshaler interface +func (v Flow) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow13(&w, v) + return w.Buffer.BuildBytes(), w.Error +} -type EasyJSON_exporter_TableReply *TableReply +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Flow) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlow13(w, v) +} -func ( TransportLayer ) MarshalJSON() ([]byte, error) { return nil, nil } -func (* TransportLayer ) UnmarshalJSON([]byte) error { return nil } -func ( TransportLayer ) MarshalEasyJSON(w *jwriter.Writer) {} -func (* TransportLayer ) UnmarshalEasyJSON(l *jlexer.Lexer) {} +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Flow) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow13(&r, v) + return r.Error() +} -type EasyJSON_exporter_TransportLayer *TransportLayer +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Flow) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlow13(l, v) +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers2(in *jlexer.Lexer, out *layers1.VRRPv2) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "contents": + if in.IsNull() { + in.Skip() + out.Contents = nil + } else { + out.Contents = in.Bytes() + } + case "payload": + if in.IsNull() { + in.Skip() + out.Payload = nil + } else { + out.Payload = in.Bytes() + } + case "version": + out.Version = uint8(in.Uint8()) + case "VirtualRtrID": + out.VirtualRtrID = uint8(in.Uint8()) + case "priority": + out.Priority = uint8(in.Uint8()) + case "CountIPAddr": + out.CountIPAddr = uint8(in.Uint8()) + case "adver_int": + out.AdverInt = uint8(in.Uint8()) + case "checksum": + out.Checksum = uint16(in.Uint16()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers2(out *jwriter.Writer, in layers1.VRRPv2) { + out.RawByte('{') + first := true + _ = first + if len(in.Contents) != 0 { + const prefix string = ",\"contents\":" + first = false + out.RawString(prefix[1:]) + out.Base64Bytes(in.Contents) + } + if len(in.Payload) != 0 { + const prefix string = ",\"payload\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Base64Bytes(in.Payload) + } + if in.Version != 0 { + const prefix string = ",\"version\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.Version)) + } + if in.VirtualRtrID != 0 { + const prefix string = ",\"VirtualRtrID\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.VirtualRtrID)) + } + if in.Priority != 0 { + const prefix string = ",\"priority\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.Priority)) + } + if in.CountIPAddr != 0 { + const prefix string = ",\"CountIPAddr\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.CountIPAddr)) + } + if in.AdverInt != 0 { + const prefix string = ",\"adver_int\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.AdverInt)) + } + if in.Checksum != 0 { + const prefix string = ",\"checksum\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.Checksum)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers1(in *jlexer.Lexer, out *layers1.DNS) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "ID": + out.ID = uint16(in.Uint16()) + case "QR": + out.QR = bool(in.Bool()) + case "op_code": + out.OpCode = string(in.String()) + case "AA": + out.AA = bool(in.Bool()) + case "TC": + out.TC = bool(in.Bool()) + case "RD": + out.RD = bool(in.Bool()) + case "RA": + out.RA = bool(in.Bool()) + case "z": + out.Z = uint8(in.Uint8()) + case "response_code": + out.ResponseCode = string(in.String()) + case "QDCount": + out.QDCount = uint16(in.Uint16()) + case "ANCount": + out.ANCount = uint16(in.Uint16()) + case "NSCount": + out.NSCount = uint16(in.Uint16()) + case "ARCount": + out.ARCount = uint16(in.Uint16()) + case "questions": + if in.IsNull() { + in.Skip() + out.Questions = nil + } else { + in.Delim('[') + if out.Questions == nil { + if !in.IsDelim(']') { + out.Questions = make([]layers1.DNSQuestion, 0, 1) + } else { + out.Questions = []layers1.DNSQuestion{} + } + } else { + out.Questions = (out.Questions)[:0] + } + for !in.IsDelim(']') { + var v25 layers1.DNSQuestion + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers3(in, &v25) + out.Questions = append(out.Questions, v25) + in.WantComma() + } + in.Delim(']') + } + case "answers": + if in.IsNull() { + in.Skip() + out.Answers = nil + } else { + in.Delim('[') + if out.Answers == nil { + if !in.IsDelim(']') { + out.Answers = make([]layers1.DNSResourceRecord, 0, 1) + } else { + out.Answers = []layers1.DNSResourceRecord{} + } + } else { + out.Answers = (out.Answers)[:0] + } + for !in.IsDelim(']') { + var v26 layers1.DNSResourceRecord + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers4(in, &v26) + out.Answers = append(out.Answers, v26) + in.WantComma() + } + in.Delim(']') + } + case "authorities": + if in.IsNull() { + in.Skip() + out.Authorities = nil + } else { + in.Delim('[') + if out.Authorities == nil { + if !in.IsDelim(']') { + out.Authorities = make([]layers1.DNSResourceRecord, 0, 1) + } else { + out.Authorities = []layers1.DNSResourceRecord{} + } + } else { + out.Authorities = (out.Authorities)[:0] + } + for !in.IsDelim(']') { + var v27 layers1.DNSResourceRecord + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers4(in, &v27) + out.Authorities = append(out.Authorities, v27) + in.WantComma() + } + in.Delim(']') + } + case "additionals": + if in.IsNull() { + in.Skip() + out.Additionals = nil + } else { + in.Delim('[') + if out.Additionals == nil { + if !in.IsDelim(']') { + out.Additionals = make([]layers1.DNSResourceRecord, 0, 1) + } else { + out.Additionals = []layers1.DNSResourceRecord{} + } + } else { + out.Additionals = (out.Additionals)[:0] + } + for !in.IsDelim(']') { + var v28 layers1.DNSResourceRecord + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers4(in, &v28) + out.Additionals = append(out.Additionals, v28) + in.WantComma() + } + in.Delim(']') + } + case "timestamp": + if data := in.Raw(); in.Ok() { + in.AddError((out.Timestamp).UnmarshalJSON(data)) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers1(out *jwriter.Writer, in layers1.DNS) { + out.RawByte('{') + first := true + _ = first + if in.ID != 0 { + const prefix string = ",\"ID\":" + first = false + out.RawString(prefix[1:]) + out.Uint16(uint16(in.ID)) + } + if in.QR { + const prefix string = ",\"QR\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.QR)) + } + if in.OpCode != "" { + const prefix string = ",\"op_code\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.OpCode)) + } + if in.AA { + const prefix string = ",\"AA\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.AA)) + } + if in.TC { + const prefix string = ",\"TC\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.TC)) + } + if in.RD { + const prefix string = ",\"RD\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.RD)) + } + if in.RA { + const prefix string = ",\"RA\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Bool(bool(in.RA)) + } + if in.Z != 0 { + const prefix string = ",\"z\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.Z)) + } + if in.ResponseCode != "" { + const prefix string = ",\"response_code\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.ResponseCode)) + } + if in.QDCount != 0 { + const prefix string = ",\"QDCount\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.QDCount)) + } + if in.ANCount != 0 { + const prefix string = ",\"ANCount\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.ANCount)) + } + if in.NSCount != 0 { + const prefix string = ",\"NSCount\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.NSCount)) + } + if in.ARCount != 0 { + const prefix string = ",\"ARCount\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.ARCount)) + } + if len(in.Questions) != 0 { + const prefix string = ",\"questions\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v29, v30 := range in.Questions { + if v29 > 0 { + out.RawByte(',') + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers3(out, v30) + } + out.RawByte(']') + } + } + if len(in.Answers) != 0 { + const prefix string = ",\"answers\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v31, v32 := range in.Answers { + if v31 > 0 { + out.RawByte(',') + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers4(out, v32) + } + out.RawByte(']') + } + } + if len(in.Authorities) != 0 { + const prefix string = ",\"authorities\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v33, v34 := range in.Authorities { + if v33 > 0 { + out.RawByte(',') + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers4(out, v34) + } + out.RawByte(']') + } + } + if len(in.Additionals) != 0 { + const prefix string = ",\"additionals\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v35, v36 := range in.Additionals { + if v35 > 0 { + out.RawByte(',') + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers4(out, v36) + } + out.RawByte(']') + } + } + { + const prefix string = ",\"timestamp\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Raw((in.Timestamp).MarshalJSON()) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers4(in *jlexer.Lexer, out *layers1.DNSResourceRecord) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "name": + out.Name = string(in.String()) + case "type": + out.Type = string(in.String()) + case "class": + out.Class = string(in.String()) + case "TTL": + out.TTL = uint32(in.Uint32()) + case "data_length": + out.DataLength = uint16(in.Uint16()) + case "IP": + out.IP = string(in.String()) + case "NS": + out.NS = string(in.String()) + case "CNAME": + out.CNAME = string(in.String()) + case "PTR": + out.PTR = string(in.String()) + case "TXTs": + if in.IsNull() { + in.Skip() + out.TXTs = nil + } else { + in.Delim('[') + if out.TXTs == nil { + if !in.IsDelim(']') { + out.TXTs = make([]string, 0, 4) + } else { + out.TXTs = []string{} + } + } else { + out.TXTs = (out.TXTs)[:0] + } + for !in.IsDelim(']') { + var v37 string + v37 = string(in.String()) + out.TXTs = append(out.TXTs, v37) + in.WantComma() + } + in.Delim(']') + } + case "SOA": + if in.IsNull() { + in.Skip() + out.SOA = nil + } else { + if out.SOA == nil { + out.SOA = new(layers1.DNSSOA) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers5(in, out.SOA) + } + case "SRV": + if in.IsNull() { + in.Skip() + out.SRV = nil + } else { + if out.SRV == nil { + out.SRV = new(layers1.DNSSRV) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers6(in, out.SRV) + } + case "MX": + if in.IsNull() { + in.Skip() + out.MX = nil + } else { + if out.MX == nil { + out.MX = new(layers1.DNSMX) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers7(in, out.MX) + } + case "OPT": + if in.IsNull() { + in.Skip() + out.OPT = nil + } else { + in.Delim('[') + if out.OPT == nil { + if !in.IsDelim(']') { + out.OPT = make([]*layers1.DNSOPT, 0, 8) + } else { + out.OPT = []*layers1.DNSOPT{} + } + } else { + out.OPT = (out.OPT)[:0] + } + for !in.IsDelim(']') { + var v38 *layers1.DNSOPT + if in.IsNull() { + in.Skip() + v38 = nil + } else { + if v38 == nil { + v38 = new(layers1.DNSOPT) + } + easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers8(in, v38) + } + out.OPT = append(out.OPT, v38) + in.WantComma() + } + in.Delim(']') + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers4(out *jwriter.Writer, in layers1.DNSResourceRecord) { + out.RawByte('{') + first := true + _ = first + if in.Name != "" { + const prefix string = ",\"name\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Name)) + } + if in.Type != "" { + const prefix string = ",\"type\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Type)) + } + if in.Class != "" { + const prefix string = ",\"class\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Class)) + } + if in.TTL != 0 { + const prefix string = ",\"TTL\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.TTL)) + } + if in.DataLength != 0 { + const prefix string = ",\"data_length\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.DataLength)) + } + if in.IP != "" { + const prefix string = ",\"IP\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.IP)) + } + if in.NS != "" { + const prefix string = ",\"NS\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.NS)) + } + if in.CNAME != "" { + const prefix string = ",\"CNAME\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.CNAME)) + } + if in.PTR != "" { + const prefix string = ",\"PTR\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.PTR)) + } + if len(in.TXTs) != 0 { + const prefix string = ",\"TXTs\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v39, v40 := range in.TXTs { + if v39 > 0 { + out.RawByte(',') + } + out.String(string(v40)) + } + out.RawByte(']') + } + } + if in.SOA != nil { + const prefix string = ",\"SOA\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers5(out, *in.SOA) + } + if in.SRV != nil { + const prefix string = ",\"SRV\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers6(out, *in.SRV) + } + if in.MX != nil { + const prefix string = ",\"MX\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers7(out, *in.MX) + } + if len(in.OPT) != 0 { + const prefix string = ",\"OPT\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + { + out.RawByte('[') + for v41, v42 := range in.OPT { + if v41 > 0 { + out.RawByte(',') + } + if v42 == nil { + out.RawString("null") + } else { + easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers8(out, *v42) + } + } + out.RawByte(']') + } + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers8(in *jlexer.Lexer, out *layers1.DNSOPT) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "Code": + out.Code = string(in.String()) + case "Data": + out.Data = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers8(out *jwriter.Writer, in layers1.DNSOPT) { + out.RawByte('{') + first := true + _ = first + if in.Code != "" { + const prefix string = ",\"Code\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Code)) + } + if in.Data != "" { + const prefix string = ",\"Data\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Data)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers7(in *jlexer.Lexer, out *layers1.DNSMX) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "preference": + out.Preference = uint16(in.Uint16()) + case "name": + out.Name = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers7(out *jwriter.Writer, in layers1.DNSMX) { + out.RawByte('{') + first := true + _ = first + if in.Preference != 0 { + const prefix string = ",\"preference\":" + first = false + out.RawString(prefix[1:]) + out.Uint16(uint16(in.Preference)) + } + if in.Name != "" { + const prefix string = ",\"name\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Name)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers6(in *jlexer.Lexer, out *layers1.DNSSRV) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "priority": + out.Priority = uint16(in.Uint16()) + case "weight": + out.Weight = uint16(in.Uint16()) + case "port": + out.Port = uint16(in.Uint16()) + case "name": + out.Name = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers6(out *jwriter.Writer, in layers1.DNSSRV) { + out.RawByte('{') + first := true + _ = first + if in.Priority != 0 { + const prefix string = ",\"priority\":" + first = false + out.RawString(prefix[1:]) + out.Uint16(uint16(in.Priority)) + } + if in.Weight != 0 { + const prefix string = ",\"weight\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.Weight)) + } + if in.Port != 0 { + const prefix string = ",\"port\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.Port)) + } + if in.Name != "" { + const prefix string = ",\"name\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Name)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers5(in *jlexer.Lexer, out *layers1.DNSSOA) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "MName": + out.MName = string(in.String()) + case "RName": + out.RName = string(in.String()) + case "serial": + out.Serial = uint32(in.Uint32()) + case "refresh": + out.Refresh = uint32(in.Uint32()) + case "retry": + out.Retry = uint32(in.Uint32()) + case "expire": + out.Expire = uint32(in.Uint32()) + case "minimum": + out.Minimum = uint32(in.Uint32()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers5(out *jwriter.Writer, in layers1.DNSSOA) { + out.RawByte('{') + first := true + _ = first + if in.MName != "" { + const prefix string = ",\"MName\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.MName)) + } + if in.RName != "" { + const prefix string = ",\"RName\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.RName)) + } + if in.Serial != 0 { + const prefix string = ",\"serial\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.Serial)) + } + if in.Refresh != 0 { + const prefix string = ",\"refresh\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.Refresh)) + } + if in.Retry != 0 { + const prefix string = ",\"retry\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.Retry)) + } + if in.Expire != 0 { + const prefix string = ",\"expire\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.Expire)) + } + if in.Minimum != 0 { + const prefix string = ",\"minimum\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.Minimum)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers3(in *jlexer.Lexer, out *layers1.DNSQuestion) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "name": + out.Name = string(in.String()) + case "type": + out.Type = string(in.String()) + case "class": + out.Class = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers3(out *jwriter.Writer, in layers1.DNSQuestion) { + out.RawByte('{') + first := true + _ = first + if in.Name != "" { + const prefix string = ",\"name\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.Name)) + } + if in.Type != "" { + const prefix string = ",\"type\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Type)) + } + if in.Class != "" { + const prefix string = ",\"class\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Class)) + } + out.RawByte('}') +} +func easyjsonA60071beDecodeGithubComSkydiveProjectSkydiveFlowLayers(in *jlexer.Lexer, out *layers1.DHCPv4) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "contents": + if in.IsNull() { + in.Skip() + out.Contents = nil + } else { + out.Contents = in.Bytes() + } + case "payload": + if in.IsNull() { + in.Skip() + out.Payload = nil + } else { + out.Payload = in.Bytes() + } + case "hardware_len": + out.HardwareLen = uint8(in.Uint8()) + case "hardware_opts": + out.HardwareOpts = uint8(in.Uint8()) + case "xid": + out.Xid = uint32(in.Uint32()) + case "secs": + out.Secs = uint16(in.Uint16()) + case "flags": + out.Flags = uint16(in.Uint16()) + case "server_name": + if in.IsNull() { + in.Skip() + out.ServerName = nil + } else { + out.ServerName = in.Bytes() + } + case "file": + if in.IsNull() { + in.Skip() + out.File = nil + } else { + out.File = in.Bytes() + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonA60071beEncodeGithubComSkydiveProjectSkydiveFlowLayers(out *jwriter.Writer, in layers1.DHCPv4) { + out.RawByte('{') + first := true + _ = first + if len(in.Contents) != 0 { + const prefix string = ",\"contents\":" + first = false + out.RawString(prefix[1:]) + out.Base64Bytes(in.Contents) + } + if len(in.Payload) != 0 { + const prefix string = ",\"payload\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Base64Bytes(in.Payload) + } + if in.HardwareLen != 0 { + const prefix string = ",\"hardware_len\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.HardwareLen)) + } + if in.HardwareOpts != 0 { + const prefix string = ",\"hardware_opts\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint8(uint8(in.HardwareOpts)) + } + if in.Xid != 0 { + const prefix string = ",\"xid\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint32(uint32(in.Xid)) + } + if in.Secs != 0 { + const prefix string = ",\"secs\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.Secs)) + } + if in.Flags != 0 { + const prefix string = ",\"flags\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Uint16(uint16(in.Flags)) + } + if len(in.ServerName) != 0 { + const prefix string = ",\"server_name\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Base64Bytes(in.ServerName) + } + if len(in.File) != 0 { + const prefix string = ",\"file\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Base64Bytes(in.File) + } + out.RawByte('}') +} diff --git a/gremlin/traversal/metrics_test.go b/gremlin/traversal/metrics_test.go index 8e6b26fdd7..9abc792b21 100644 --- a/gremlin/traversal/metrics_test.go +++ b/gremlin/traversal/metrics_test.go @@ -26,6 +26,7 @@ import ( "github.com/skydive-project/skydive/flow" "github.com/skydive-project/skydive/graffiti/graph" "github.com/skydive-project/skydive/graffiti/graph/traversal" + "github.com/skydive-project/skydive/graffiti/service" ) type FakeGraphBackend struct { diff --git a/scripts/ci/run-cdd-overview-tests.sh b/scripts/ci/run-cdd-overview-tests.sh index 3047a6804a..ac2738f7eb 100755 --- a/scripts/ci/run-cdd-overview-tests.sh +++ b/scripts/ci/run-cdd-overview-tests.sh @@ -2,7 +2,7 @@ set -v -dir="$(dirname "$0")" +DIR="$(dirname "$0")" sudo iptables -F sudo iptables -P FORWARD ACCEPT @@ -11,10 +11,13 @@ for i in $(find /proc/sys/net/bridge/ -type f) ; do echo 0 | sudo tee $i ; done cd ${GOPATH}/src/github.com/skydive-project/skydive make install -export ELASTICSEARCH=localhost:9200 +export ELASTICSEARCH=localhost:9201 export SKYDIVE=${GOPATH}/bin/skydive export SKYDIVE_LOGGING_LEVEL=DEBUG +. "$DIR/run-tests-utils.sh" +es_setup && trap es_cleanup EXIT + make test.functionals WITH_CDD=true TAGS=${TAGS} VERBOSE=true TIMEOUT=10m TEST_PATTERN=Overview status=$? @@ -26,5 +29,5 @@ fi set -e -"${dir}/convert-to-gif.sh" tests/overview.mp4 tests/overview-tmp.gif +"${DIR}/convert-to-gif.sh" tests/overview.mp4 tests/overview-tmp.gif gifsicle -O3 tests/overview-tmp.gif -o tests/overview.gif \ No newline at end of file diff --git a/scripts/ci/run-scale.sh b/scripts/ci/run-scale.sh index a3170e4da4..1857566c8d 100755 --- a/scripts/ci/run-scale.sh +++ b/scripts/ci/run-scale.sh @@ -2,7 +2,7 @@ set -v -dir="$(dirname "$0")" +DIR="$(dirname "$0")" sudo iptables -F sudo iptables -P FORWARD ACCEPT @@ -12,12 +12,15 @@ cd ${GOPATH}/src/github.com/skydive-project/skydive make install export SKYDIVE_ANALYZERS=localhost:8082 -export ELASTICSEARCH=localhost:9200 +export ELASTICSEARCH=localhost:9201 export TLS=true export SKYDIVE=${GOPATH}/bin/skydive export FLOW_PROTOCOL=${FLOW_PROTOCOL:-websocket} export SKYDIVE_LOGGING_LEVEL=DEBUG +. "$DIR/run-tests-utils.sh" +es_setup && trap es_cleanup EXIT + make test.functionals WITH_SCALE=true TAGS=${TAGS} VERBOSE=true TIMEOUT=10m TEST_PATTERN=Scale EXTRA_ARGS="-logs=/tmp/skydive-scale/scale.log" status=$? diff --git a/scripts/ci/run-tests-utils.sh b/scripts/ci/run-tests-utils.sh index 408a922605..8050767e3c 100755 --- a/scripts/ci/run-tests-utils.sh +++ b/scripts/ci/run-tests-utils.sh @@ -16,6 +16,15 @@ mem_prof() { done } +es_setup() { + docker run -d --name elasticsearch -p 9201:9200 -p 9301:9300 -e "discovery.type=single-node" elasticsearch:7.7.1 +} + +es_cleanup() { + docker stop elasticsearch + docker rm elasticsearch +} + tests_run() { cd ${GOPATH}/src/github.com/skydive-project/skydive @@ -27,6 +36,11 @@ tests_run() { TESTFILE=$WORKSPACE/tests.xml BACKEND=${BACKEND:-memory} + + if [ "$BACKEND" = "elasticsearch" ]; then + es_setup && trap es_cleanup EXIT + fi + ARGS="$ARGS -standalone -analyzer.topology.backend $BACKEND -analyzer.flow.backend $BACKEND" export ORIENTDB_ROOT_PASSWORD=root diff --git a/tests/tests.go b/tests/tests.go index 3a898a2275..8522d5f33f 100644 --- a/tests/tests.go +++ b/tests/tests.go @@ -134,6 +134,8 @@ storage: database: Skydive username: root password: {{.OrientDBRootPassword}} + elasticsearch: + host: 127.0.0.1:9201 logging: level: DEBUG