This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Cloud Ninja's profile picture

Networking API - Connect Yourselves

Started by Cloud Ninja, 06 March 2016 - 12:14 AM
Cloud Ninja #1
Posted 06 March 2016 - 01:14 AM
A description

This networking API was initially built to simulate WIFI/LAN networks inside of Computercraft using a router based solution. What it turned into was more or less a security solution to localize traffic.

This API works similarly to rednet but without being able to be sniffed through just ONE channel (see my other program NetUtil/Libpcap & Libspoofer)

The way it works

This API uses one file to allow the creating, connecting/disconnecting to a wifi/lan network (or both if you set it up as such) to allow sending over that password protected network.

Passwords and SSID's for the network are not sent over the network, merely via Server to Connectee.



Pastebin: pastebin get pAksK8i6 net

Functions

Spoiler

scan() | Scans the area for SSID's and puts them into a table

getSSIDTable() | Returns all SSID's found in the scan
connect(ssid, passwd) | connects to the given SSID with the given password
disconnect() | disconnects you from current network
host(ssid, passwd) | starts up a host session with given SSID with the password being the given password
send(message, recipient) | send a message to recipient (note: recipients should be CC Computer ID's)

receive() | listen for messages coming to the receiving computers ID

Usage

To host a router session use net.host(SSID, password)

To join, use net.connect(SSID, password)

To send, use net.send(msg, to)

To receive, use net.receive()


Have fun and enjoy


Credits

Main programmer | Scoopta

Other odds and ends in program | ME!
Edited on 06 March 2016 - 07:18 PM
X3ME #2
Posted 13 March 2016 - 09:46 PM
This is brilliant, how come this doesnt have a single reply?
Imma start using this on an upcoming project ;)/>
Cloud Ninja #3
Posted 14 March 2016 - 02:49 AM
This is brilliant, how come this doesnt have a single reply?
Imma start using this on an upcoming project ;)/>
haha i dont know, i thought it was pretty clever. Thanks for wanting to use it though, took a bit of time to get the kinks we could find worked out, if you find any bugs, please let us know!