pcap-cli/schema/proto/packet.proto (85 lines of code) (raw):
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/GoogleCloudPlatform/pcap-sidecar/pcap-cli/internal/pb";
message Packet {
message Pcap {
string context = 1;
uint64 serial = 2;
}
message Metadata {
bool truncated = 1;
uint64 length = 2;
uint64 capture_length = 3;
}
message Interface {
uint32 index = 1;
string name = 2;
repeated string addrs = 3;
}
message Layer2 {
string source = 1;
string target = 2;
string type = 3;
}
message Layer3 {
string source = 1;
string target = 2;
}
message L3ProtoIPv4 {
bytes source = 1;
bytes target = 2;
}
message L3ProtoIPv6 {
bytes source = 1;
bytes target = 2;
}
message L4ProtoUDP {
uint32 source = 1;
uint32 target = 2;
}
message TcpFlags {
uint32 flags = 1;
bool syn = 2;
bool ack = 3;
bool psh = 4;
bool fin = 5;
bool rst = 6;
bool urg = 7;
bool ece = 8;
bool cwr = 9;
}
message L4ProtoTCP {
uint32 source = 1;
uint32 target = 2;
uint32 seq = 3;
uint32 ack = 4;
TcpFlags flags = 5;
}
Pcap pcap = 1;
Metadata meta = 2;
google.protobuf.Timestamp timestamp = 3;
Interface iface = 4;
Layer2 l2 = 5;
oneof l3 {
Layer3 ip = 6;
L3ProtoIPv4 ip4 = 7;
L3ProtoIPv6 ip6 = 8;
}
oneof l4 {
L4ProtoUDP udp = 9;
L4ProtoTCP tcp = 10;
}
}