-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network Settings Objects Generation #153
Conversation
4c25da1
to
01960af
Compare
@JettChenT can you have a look at this and why the rust /win build is failing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. It even comes with tests!!
This represents a huge amount of work, spanning a lot of different components and it is extremely well done. I left a few minor comments, but let's get this merged!
return try JSONDecoder().decode(Response<U>.self, from: data).result | ||
} | ||
func send_raw(_ request: Data) async throws -> Data { | ||
try await withCheckedThrowingContinuation { continuation in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move the continuation to an extension so that we can keep BurrowIpc
more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
As I understand it, should we move the continuations inside BurrowIpc
as functions to extension NWConnection
? Moving the continuations into an extension of BurrowIpc
itself might require moving all the functions that depend on it into the extension.
guard let addr = cfig.address else { | ||
return nil | ||
} | ||
let nst = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addr should go in NEPacketTunnelNetworkSettings.ipv4Settings.addresses
instead
tunnelRemoteAddress
is intended to be the IP address of the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! Currently I've updated this part to:
var nst = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "1.1.1.1")
nst.ipv4Settings = NEIPv4Settings(addresses: [addr], subnetMasks: ["0.0.0.0"])
Seeing that we will be handling the network interface after its initialization on the daemon side, I suppose the tunnelRemoteAddress
field of this would not influence any behavior of the program? The program will error when no tunnelRemoteAddress
is specified, so I put a makeshift 1.1.1.1
there.
Also, I'm wondering if we should also send the TunInterface.netmask()
information to the frontend for ipv4Settings initialization.
Rebase failed
bd21d8c
to
8f6e0fa
Compare
This generates and applies NetworkSettings object with unix socket IPC. - domain socket, json-rpc based communication - switches to anyhow for burrow crate - adds support for starting daemons on macos
#53
This PR does the following: