Skip to content

Instantly share code, notes, and snippets.

View aravindhkumar23's full-sized avatar

aravindhkumar aravindhkumar23

View GitHub Profile
@aravindhkumar23
aravindhkumar23 / DNS_resolver
Created April 4, 2023 13:37
DNS resolver - test implemention - not prod ready
func handlePacket(packetData: Data,syntheticIp: String) {
if(syntheticIp == "" || syntheticIp.isEmpty){
os_log(.default, log: self.log, "*****No synthetic ip found")
return
}
let udpPayload : Data = packetData[28..<packetData.count]
do {
//to deserialize we used https://github.com/Bouke/DNS
let dnsQuery = try Message(deserialize: udpPayload)
@aravindhkumar23
aravindhkumar23 / ViewController.swift
Created September 27, 2023 12:07
C-based implementation for nw_connection_t and swift implementation for NWConnection [adding it here so that some developers will get help from this.]. Adding to this [(NW_PARAMETERS_DEFAULT_CONFIGURATION, NW_PARAMETERS_DEFAULT_CONFIGURATION)] macros for nw_parameters_create_secure_tcp is not available in swift so we need to create an obj-c brid…
//
// ViewController.swift
// vpn-client
//
// Created by Aravindh Kumar on 9/13/23.
//
import UIKit
import Network
import NetworkExtension