Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/guestagent/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ func (c *GuestAgentClient) Tunnel(ctx context.Context) (api.GuestService_TunnelC
}
return stream, nil
}

func (c *GuestAgentClient) IPv4(ctx context.Context) (*api.CommandOutput, error) {
return c.cli.GetIPv4(ctx, &emptypb.Empty{})
}

func (c *GuestAgentClient) IPv6(ctx context.Context) (*api.CommandOutput, error) {
return c.cli.GetIPv6(ctx, &emptypb.Empty{})
}
13 changes: 9 additions & 4 deletions pkg/guestagent/api/guestservice.pb.desc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

…
¯
guestservice.protogoogle/protobuf/empty.protogoogle/protobuf/timestamp.proto"0
Info(
local_ports ( 2.IPPortR
Expand All @@ -12,7 +12,10 @@ localPorts"
IPPort
protocol ( Rprotocol
ip ( Rip
port (Rport"X
port (Rport"B
CommandOutput
is_json (RisJson
payload ( Rpayload"X
Inotify

mount_path ( R mountPath.
Expand All @@ -23,9 +26,11 @@ mount_path ( R mountPath.
data ( Rdata

guest_addr ( R guestAddr&
udp_target_addr ( RudpTargetAddr2È
udp_target_addr ( RudpTargetAddr2®
GuestService(
GetInfo.google.protobuf.Empty.Info-
GetEvents.google.protobuf.Empty.Event01
PostInotify.Inotify.google.protobuf.Empty(,
Tunnel.TunnelMessage.TunnelMessage(0B/Z-github.com/lima-vm/lima/v2/pkg/guestagent/apibproto3
Tunnel.TunnelMessage.TunnelMessage(01
GetIPv4.google.protobuf.Empty.CommandOutput1
GetIPv6.google.protobuf.Empty.CommandOutputB/Z-github.com/lima-vm/lima/v2/pkg/guestagent/apibproto3
Expand Down
208 changes: 145 additions & 63 deletions pkg/guestagent/api/guestservice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/guestagent/api/guestservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ service GuestService {
rpc PostInotify(stream Inotify) returns (google.protobuf.Empty);

rpc Tunnel(stream TunnelMessage) returns (stream TunnelMessage);
rpc GetIPv4(google.protobuf.Empty) returns (CommandOutput);
rpc GetIPv6(google.protobuf.Empty) returns (CommandOutput);
}

message Info {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think that the IP can be added here without wrapping it in CommandOutput

#3616 (comment)

Expand All @@ -30,6 +32,11 @@ message IPPort {
int32 port = 3;
}

message CommandOutput {
bool is_json = 1;
bytes payload = 2;
}

message Inotify {
string mount_path = 1;
google.protobuf.Timestamp time = 2;
Expand Down
Loading
Loading