mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 07:38:30 +00:00
Automated rebrand of all openclaw references to hanzo bot: - Package: openclaw -> @hanzo/bot - Binary: openclaw -> hanzo-bot - Config: ~/.openclaw -> ~/.hanzo/bot - Docker: ghcr.io/hanzoai/bot - Env vars: OPENCLAW_* -> BOT_* - Bundle IDs: ai.hanzo.bot.* - Product name: Hanzo Bot
22 lines
661 B
Swift
22 lines
661 B
Swift
import Foundation
|
|
import Hanzo BotKit
|
|
|
|
public enum TailscaleNetwork {
|
|
public static func isTailnetIPv4(_ address: String) -> Bool {
|
|
let parts = address.split(separator: ".")
|
|
guard parts.count == 4 else { return false }
|
|
let octets = parts.compactMap { Int($0) }
|
|
guard octets.count == 4 else { return false }
|
|
let a = octets[0]
|
|
let b = octets[1]
|
|
return a == 100 && b >= 64 && b <= 127
|
|
}
|
|
|
|
public static func detectTailnetIPv4() -> String? {
|
|
for entry in NetworkInterfaceIPv4.addresses() where self.isTailnetIPv4(entry.ip) {
|
|
return entry.ip
|
|
}
|
|
return nil
|
|
}
|
|
}
|