minor ios API update
This commit is contained in:
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Bucket
|
||||||
|
type = "1"
|
||||||
|
version = "2.0">
|
||||||
|
<Breakpoints>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Example_iOS_App/ViewController.swift"
|
||||||
|
timestampString = "492476189.334255"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "56"
|
||||||
|
endingLineNumber = "56"
|
||||||
|
landmarkName = "UI_TX(_:)"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Example_iOS_App/ViewController.swift"
|
||||||
|
timestampString = "492477955.572263"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "249"
|
||||||
|
endingLineNumber = "249"
|
||||||
|
landmarkName = "update_rx()"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "No"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Example_iOS_App/ViewController.swift"
|
||||||
|
timestampString = "492482204.82335"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "283"
|
||||||
|
endingLineNumber = "283"
|
||||||
|
landmarkName = "update_rx()"
|
||||||
|
landmarkType = "5">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
|
</Breakpoints>
|
||||||
|
</Bucket>
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</segmentedControl>
|
</segmentedControl>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="ZeroTier iOS Example App" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h4F-YA-Rsh">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="ZeroTier iOS Example App" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h4F-YA-Rsh">
|
||||||
<rect key="frame" x="20" y="42" width="200" height="21"/>
|
<rect key="frame" x="20" y="59" width="200" height="21"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IXS-rJ-KKM">
|
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="IXS-rJ-KKM">
|
||||||
<rect key="frame" x="208" y="77" width="30" height="30"/>
|
<rect key="frame" x="208" y="94" width="30" height="30"/>
|
||||||
<state key="normal" title="Join"/>
|
<state key="normal" title="Join"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="UI_JoinNetwork:" destination="BYZ-38-t0r" eventType="touchUpInside" id="kem-tf-1h1"/>
|
<action selector="UI_JoinNetwork:" destination="BYZ-38-t0r" eventType="touchUpInside" id="kem-tf-1h1"/>
|
||||||
@@ -130,18 +130,30 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="nwid" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="TvY-qZ-Zjm">
|
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="nwid" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="TvY-qZ-Zjm">
|
||||||
<rect key="frame" x="20" y="77" width="167" height="30"/>
|
<rect key="frame" x="20" y="94" width="167" height="30"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||||
<textInputTraits key="textInputTraits"/>
|
<textInputTraits key="textInputTraits"/>
|
||||||
</textField>
|
</textField>
|
||||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fU2-IH-aMf">
|
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fU2-IH-aMf">
|
||||||
<rect key="frame" x="208" y="105" width="40" height="30"/>
|
<rect key="frame" x="208" y="122" width="40" height="30"/>
|
||||||
<state key="normal" title="Leave"/>
|
<state key="normal" title="Leave"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="UI_LeaveNetwork:" destination="BYZ-38-t0r" eventType="touchUpInside" id="7Pg-IK-dMo"/>
|
<action selector="UI_LeaveNetwork:" destination="BYZ-38-t0r" eventType="touchUpInside" id="7Pg-IK-dMo"/>
|
||||||
<action selector="btnLeaveNetwork:" destination="BYZ-38-t0r" eventType="touchUpInside" id="hmg-2Y-GCl"/>
|
<action selector="btnLeaveNetwork:" destination="BYZ-38-t0r" eventType="touchUpInside" id="hmg-2Y-GCl"/>
|
||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q7W-t2-dqo">
|
||||||
|
<rect key="frame" x="20" y="28" width="320" height="28"/>
|
||||||
|
<attributedString key="attributedText">
|
||||||
|
<fragment content="-1.-1.-1.-1/-1">
|
||||||
|
<attributes>
|
||||||
|
<color key="NSColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||||
|
<font key="NSFont" size="24" name="HelveticaNeue"/>
|
||||||
|
</attributes>
|
||||||
|
</fragment>
|
||||||
|
</attributedString>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
<variation key="default">
|
<variation key="default">
|
||||||
@@ -159,6 +171,7 @@
|
|||||||
<outlet property="btnLeaveNetwork" destination="fU2-IH-aMf" id="YwN-GB-2tc"/>
|
<outlet property="btnLeaveNetwork" destination="fU2-IH-aMf" id="YwN-GB-2tc"/>
|
||||||
<outlet property="btnRX" destination="dp1-qj-Mq8" id="vVr-s4-AX9"/>
|
<outlet property="btnRX" destination="dp1-qj-Mq8" id="vVr-s4-AX9"/>
|
||||||
<outlet property="btnTX" destination="BfY-Te-yWV" id="KTA-eE-Rhy"/>
|
<outlet property="btnTX" destination="BfY-Te-yWV" id="KTA-eE-Rhy"/>
|
||||||
|
<outlet property="lblAddress" destination="Q7W-t2-dqo" id="m0T-dL-QB1"/>
|
||||||
<outlet property="segmentProtocol" destination="vwT-sy-CRY" id="BcU-8W-7kX"/>
|
<outlet property="segmentProtocol" destination="vwT-sy-CRY" id="BcU-8W-7kX"/>
|
||||||
<outlet property="txtAddr" destination="6id-4C-E8W" id="q3w-zX-ZFf"/>
|
<outlet property="txtAddr" destination="6id-4C-E8W" id="q3w-zX-ZFf"/>
|
||||||
<outlet property="txtNWID" destination="TvY-qZ-Zjm" id="1Jc-3U-PIE"/>
|
<outlet property="txtNWID" destination="TvY-qZ-Zjm" id="1Jc-3U-PIE"/>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import UIKit
|
|||||||
class ViewController: UIViewController {
|
class ViewController: UIViewController {
|
||||||
|
|
||||||
var serverPort:UInt16 = 8080
|
var serverPort:UInt16 = 8080
|
||||||
var serverAddr:String = "10.9.9.203"
|
var serverAddr:String = "10.9.9.100"
|
||||||
var selectedProtocol:Int32 = 0
|
var selectedProtocol:Int32 = 0
|
||||||
var sock:Int32 = -1
|
var sock:Int32 = -1
|
||||||
var accepted_sock:Int32 = -1
|
var accepted_sock:Int32 = -1
|
||||||
@@ -39,7 +39,9 @@ class ViewController: UIViewController {
|
|||||||
// UDP
|
// UDP
|
||||||
if(selectedProtocol == SOCK_DGRAM)
|
if(selectedProtocol == SOCK_DGRAM)
|
||||||
{
|
{
|
||||||
// recvfrom
|
var buffer = [UInt8](count: 100, repeatedValue: 0)
|
||||||
|
read(sock, &buffer, 100);
|
||||||
|
print(buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,13 +52,12 @@ class ViewController: UIViewController {
|
|||||||
// TCP
|
// TCP
|
||||||
if(selectedProtocol == SOCK_STREAM)
|
if(selectedProtocol == SOCK_STREAM)
|
||||||
{
|
{
|
||||||
print("writing...")
|
|
||||||
write(sock, txtTX.description, txtTX.description.characters.count);
|
write(sock, txtTX.description, txtTX.description.characters.count);
|
||||||
}
|
}
|
||||||
// UDP
|
// UDP
|
||||||
if(selectedProtocol == SOCK_DGRAM)
|
if(selectedProtocol == SOCK_DGRAM)
|
||||||
{
|
{
|
||||||
// sendto
|
sendto(sock, txtTX.description, txtTX.description.characters.count, 0, UnsafePointer<sockaddr>([udp_addr]), UInt32(udp_addr.sin_len))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,6 +133,8 @@ class ViewController: UIViewController {
|
|||||||
var bind_thread : NSThread!
|
var bind_thread : NSThread!
|
||||||
func attempt_bind()
|
func attempt_bind()
|
||||||
{
|
{
|
||||||
|
var err:Int32
|
||||||
|
|
||||||
// TCP
|
// TCP
|
||||||
if(selectedProtocol == SOCK_STREAM)
|
if(selectedProtocol == SOCK_STREAM)
|
||||||
{
|
{
|
||||||
@@ -169,10 +172,23 @@ class ViewController: UIViewController {
|
|||||||
// UDP
|
// UDP
|
||||||
if(selectedProtocol == SOCK_DGRAM)
|
if(selectedProtocol == SOCK_DGRAM)
|
||||||
{
|
{
|
||||||
|
var addr = sockaddr_in(sin_len: UInt8(sizeof(sockaddr_in)),
|
||||||
|
sin_family: UInt8(AF_INET),
|
||||||
|
sin_port: UInt16(serverPort).bigEndian,
|
||||||
|
sin_addr: in_addr(s_addr: 0),
|
||||||
|
sin_zero: (0,0,0,0,0,0,0,0))
|
||||||
|
|
||||||
|
|
||||||
|
sock = zt_socket(AF_INET, SOCK_DGRAM, 0)
|
||||||
|
err = zt_bind(sock, UnsafePointer<sockaddr>([addr]), UInt32(addr.sin_len))
|
||||||
|
print("bind_err = ", err)
|
||||||
|
|
||||||
|
err = zt_listen(sock, 0)
|
||||||
|
print("listen_err = ", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBOutlet weak var txtAddress: UITextField!
|
||||||
// Bind a ZeroTier socket
|
// Bind a ZeroTier socket
|
||||||
@IBAction func UI_Bind(sender: AnyObject) {
|
@IBAction func UI_Bind(sender: AnyObject) {
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), {
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), {
|
||||||
@@ -181,16 +197,27 @@ class ViewController: UIViewController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBOutlet weak var lblAddress: UILabel!
|
||||||
|
|
||||||
|
|
||||||
|
var udp_addr:sockaddr_in!
|
||||||
|
|
||||||
// Watch for incoming data
|
// Watch for incoming data
|
||||||
var rx_thread : NSThread!
|
var rx_thread : NSThread!
|
||||||
func update_rx() {
|
func update_rx() {
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
dispatch_async(dispatch_get_main_queue()) {
|
||||||
|
var str_buf = [Int8](count: 16, repeatedValue: 0)
|
||||||
|
zt_get_addresses(self.txtNWID.text!, &str_buf);
|
||||||
|
self.lblAddress.text = String.fromCString(str_buf)
|
||||||
|
}
|
||||||
|
|
||||||
// TCP
|
// TCP
|
||||||
if(selectedProtocol == SOCK_STREAM)
|
if(selectedProtocol == SOCK_STREAM)
|
||||||
{
|
{
|
||||||
var len = 32
|
let len = 32
|
||||||
var buffer = [UInt8](count: len, repeatedValue: 0)
|
var buffer = [UInt8](count: len, repeatedValue: 0)
|
||||||
let n = read(accepted_sock, &buffer, len);
|
let n = read(accepted_sock, &buffer, len);
|
||||||
if(n > 0)
|
if(n > 0)
|
||||||
@@ -207,7 +234,86 @@ class ViewController: UIViewController {
|
|||||||
// UDP
|
// UDP
|
||||||
if(selectedProtocol == SOCK_DGRAM)
|
if(selectedProtocol == SOCK_DGRAM)
|
||||||
{
|
{
|
||||||
// recvfrom
|
let len = 32
|
||||||
|
var buffer = [UInt8](count: len, repeatedValue: 0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
udp_addr = sockaddr_in(sin_len: UInt8(sizeof(sockaddr_in)),
|
||||||
|
sin_family: UInt8(AF_INET),
|
||||||
|
sin_port: UInt16(0).bigEndian,
|
||||||
|
sin_addr: in_addr(s_addr: 0),
|
||||||
|
sin_zero: (0,0,0,0,0,0,0,0))
|
||||||
|
|
||||||
|
var addrlen:socklen_t = 0;
|
||||||
|
var legIntPtr = withUnsafeMutablePointer(&addrlen, { $0 })
|
||||||
|
let n = recvfrom(sock, &buffer, len, 0, UnsafeMutablePointer<sockaddr>([udp_addr]), legIntPtr)
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var socketAddress = sockaddr_storage()
|
||||||
|
var socketAddressLength = socklen_t(sizeof(sockaddr_storage.self))
|
||||||
|
|
||||||
|
let bytesRead = withUnsafeMutablePointers(&socketAddress, &socketAddressLength) {
|
||||||
|
recvfrom(sock, UnsafeMutablePointer<Void>(buffer), len, 0, UnsafeMutablePointer($0), UnsafeMutablePointer($1))
|
||||||
|
//recvfrom(<#T##Int32#>, <#T##UnsafeMutablePointer<Void>#>, <#T##Int#>, <#T##Int32#>, <#T##UnsafeMutablePointer<sockaddr>#>, <#T##UnsafeMutablePointer<socklen_t>#>)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
let host = CFHostCreateWithName(kCFAllocatorDefault, "google.com").takeRetainedValue()
|
||||||
|
var resolved = CFHostStartInfoResolution(host, .Addresses, nil)
|
||||||
|
let addresses = CFHostGetAddressing(host, &resolved)?.takeUnretainedValue() as! [NSData]?
|
||||||
|
|
||||||
|
|
||||||
|
if let data = addresses?.first {*/
|
||||||
|
//var storage = sockaddr_storage()
|
||||||
|
//data.getBytes(&storage, length: sizeof(sockaddr_storage))
|
||||||
|
|
||||||
|
// if Int32(storage.ss_family) == AF_INET {
|
||||||
|
// let addr4 = withUnsafePointer(&storage) { UnsafePointer<sockaddr_in>($0).memory }
|
||||||
|
|
||||||
|
// prints 74.125.239.132
|
||||||
|
// print(String(CString: inet_ntoa(addr4.sin_addr), encoding: NSASCIIStringEncoding))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
//var s_addr:sockaddr_in = (sockaddr_in)&socketAddress
|
||||||
|
|
||||||
|
//var s_addr = UnsafeMutablePointer<sockaddr>(storage)
|
||||||
|
|
||||||
|
if(bytesRead > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
//try withUnsafeMutablePointer(&socketAddress) {
|
||||||
|
// try sendto(sock, buffer, len, 0, UnsafeMutablePointer<sockaddr>($0), socklen_t(socketAddress.sin.sin_len))
|
||||||
|
//}
|
||||||
|
|
||||||
|
print("socketAddressLength = ", socketAddressLength);
|
||||||
|
|
||||||
|
|
||||||
|
let bytesWritten = withUnsafePointer(&socketAddress) {
|
||||||
|
print("TXing...\n");
|
||||||
|
sendto(sock, UnsafePointer(buffer), bytesRead, 0, UnsafePointer<sockaddr>($0), socketAddressLength)
|
||||||
|
}
|
||||||
|
|
||||||
|
print("bytesWritten = ", bytesWritten);
|
||||||
|
|
||||||
|
/*
|
||||||
|
let bytesWritten = withUnsafePointer(&socketAddress.sin) {
|
||||||
|
sendto(sock, buffer, len, 0, UnsafePointer($0), socklen_t(socketAddress.sin.sin_len))
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if let str = String(data: NSData(bytes: &buffer, length: len), encoding: NSUTF8StringEncoding) {
|
||||||
|
dispatch_async(dispatch_get_main_queue()) {
|
||||||
|
self.txtRX.text = str
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print("not a valid UTF-8 sequence")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,13 +322,13 @@ class ViewController: UIViewController {
|
|||||||
var service_thread : NSThread!
|
var service_thread : NSThread!
|
||||||
func ztnc_start_service() {
|
func ztnc_start_service() {
|
||||||
let path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)
|
let path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)
|
||||||
start_service_and_rpc(path[0],"XXXXXXXXXXXXXXXX")
|
start_service_and_rpc(path[0],"8056c2e21c000001")
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
txtNWID.text = "XXXXXXXXXXXXXXXX"
|
txtNWID.text = "8056c2e21c000001"
|
||||||
txtTX.text = "welcome to the machine"
|
txtTX.text = "welcome to the machine"
|
||||||
txtAddr.text = "0.0.0.0"
|
txtAddr.text = "0.0.0.0"
|
||||||
serverAddr = "0.0.0.0"
|
serverAddr = "0.0.0.0"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ void enable_intercept();
|
|||||||
|
|
||||||
void zt_join_network(const char *nwid);
|
void zt_join_network(const char *nwid);
|
||||||
void zt_leave_network(const char *nwid);
|
void zt_leave_network(const char *nwid);
|
||||||
|
void zt_get_addresses(const char *nwid, char * addrstr);
|
||||||
|
|
||||||
// Direct Call ZT API
|
// Direct Call ZT API
|
||||||
// These functions will provide direct access to ZT-enabled sockets with no hassle
|
// These functions will provide direct access to ZT-enabled sockets with no hassle
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ extern "C" void zt_leave_network(const char * nwid){
|
|||||||
zts_leave_network(nwid);
|
zts_leave_network(nwid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns a list of addresses associated with this device on the given network
|
||||||
|
extern "C" void zt_get_addresses(const char * nwid, char * addrstr) {
|
||||||
|
zts_get_addresses(nwid, addrstr);
|
||||||
|
}
|
||||||
|
|
||||||
// Explicit ZT API wrappers
|
// Explicit ZT API wrappers
|
||||||
#if !defined(__IOS__)
|
#if !defined(__IOS__)
|
||||||
// This isn't available for iOS since function interposition isn't as reliable
|
// This isn't available for iOS since function interposition isn't as reliable
|
||||||
|
|||||||
Reference in New Issue
Block a user