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

The Internet Pack - Featuring the future of networking [Firewall added!]

Started by samrg472, 30 June 2012 - 02:28 AM
samrg472 #1
Posted 30 June 2012 - 04:28 AM
<=The Internet Pack=>


The Internet Pack is a software package of which contains some of the greatest networking software.
It contains some needed tools for the server and client to communicate, securely and with reliability. The team of The Internet Pack is Sledger721 &amp; I (samrg472).
Make sure to give credit if you take code from the team


Servers it comes with:
  • DNS server
There will be more servers in future releases..

APIs it comes with:
  • DNS API
  • Firewall API
Also more APIs in the feature too. :P/>/>
IRC Network: irc.esper.net
IRC Channel: #theinternetpack
You may visit The Internet Pack channel at any time for help

Future software includes an FTP server, HTTP server, Firewall, LAN &amp; Router support and more.
You may use any of the code in you're software as long as credit is given to the team who created this


Server Downloads:API Downloads:Misc Downloads:
  • Demo DNS send client – Requires DNS API and sends a message to the DNS Server and prints back what the DNS Server finds
  • Demo Firewall test – Requires Firewall and tests your configuration; send a message to the receiver, save this program as "receive"
Any suggestions &amp; CONSTRUCTIVE feedback is welcomed. :)/>/>

All about DNS:
————————
Using the DNS Server:

1) Download the software packages dns &amp; dns-M in the root directory of the pc
2) Make three files dataA, dataC, and dataT
3) Inserting A-Rrecord entries:	  
3a) Open dataA	  
		  3b) Insert -> A:0:www.example.com
		  -- A is for A-Record
		  -- 0 is the computer ID you want the address to point to
		  -- www.example.com can be any domain you wish
4) Inserting CNAME-Record entries:
	  4a) Open dataC
	  4b) Insert -> C:www.test.com:www.example.com
		  -- C is for CNAME-Record
		  -- www.test.com is where www.example.com points to
		  -- www.example.com points to www.test.com
			   -- Useful if you make multiple domains that point to one master domain
5) Inserting TXT-Record entries:
	  5a) Open dataT
	  5b) Insert -> T:I'm a TXT record:www.example.com
		  -- DONT PUT ":" IN THE TXT RECORD! IT WILL BREAK!!!
		  -- T is for TXT-Record
		  -- "I'm a TXT record" is the TXT record
		  -- www.example.com is what address the txt is assigned to			
				  -- Useful to provide extra information about a domain
6) Launch dns-M and the server will be active!

DNS API:
-- id is simply the id of the DNS Server
-- valid record types are C, A, and T
-- address is the domain e.g. www.domain.com
dns.resolve(id,"record","address")-- Sample dns programos.loadAPI("dns")rednet.open("top")
-- rednet.receive() is built directly in the dns api
-- so you don't have to call ith = dns.resolve(0,"A","www.example.com") print(h)
————————
Using the Firewall:

Note: The Firewall defaults to denying ALL.
1) Download the firewall to a place of your choice.
2) Open the firewall and customize the RulesPath (default: file named "rules" in root directory)
3) Open the rules file
4) Insert rules of your choice (see rules section)
5) Use the Firewall API in your software! (see the Firewall API)

Firewall API:
-- It works exactly rednet.receive() except id is false and msg is nil IF the id has been denied
-- message and distance is self explanatory
id, msg, distance = firewall.receive()

-- status is either "accepted" or "denied", the id, msg, and distance WILL be the actual id, msg, and distance,
-- Useful if you want to send things back to the sender if they have been rejected
status, id, msg, distance = firewall.receiveAll()

Firewall rules:
Note: All rules are separated by a line
The first word is always "accept" or "drop"
"*" are supported which means ALL
But instead of a * you can put an ID
– This will drop ID 10 and allow the rest
e.g.
drop 10
accept *

————————

<=TODO=>
  • Start the future projects
<=Changelog=>

Firewall v1.1
  • Allow receiveAll() function to return status unknown (caused by invalid keywords in rules file)
  • Fixed a bug in the receive() function returning the id and message no matter what
Firewall v1.0
  • Initial post of the firewall and other software with the firewall

Initial Release
  • Posted initial software
Lyqyd #2
Posted 30 June 2012 - 10:30 AM
This area of the forums is for completed programs. Did you forget the download link?
samrg472 #3
Posted 30 June 2012 - 03:00 PM
Sorry download is currently unvailable, I will get the download out tomorrow

@Lyqyd

Am I missing something?
I was in a rush making this post and had to leave, so I didn't time to get the download yesterday
enderguy #4
Posted 30 June 2012 - 03:08 PM
hey could i help out with making it?

I'm actually making my own system too where you could private message people, have a server to host some things, and i have a gps program that i call "tomtom" refrence to real life tomtom lol
samrg472 #5
Posted 30 June 2012 - 03:53 PM
Download link posted

1) DNS Server
2) DNS API
3) Demo send client

Demo Send Client is useful to make sure you properly setup a record for your domain; sending and receiving messages peroperly and other useful things

It also demonstrates the use of the DNS API.

Enjoy. :P/>/>
Mandrake Fernflower #6
Posted 01 July 2012 - 12:51 AM
Cheers Mate, Great job on the code it was also fun to read aswell
samrg472 #7
Posted 01 July 2012 - 02:37 AM
Cheers Mate, Great job on the code it was also fun to read aswell

Thanks. :P/>/>
Lyqyd #8
Posted 01 July 2012 - 08:30 AM
Sorry download is currently unvailable, I will get the download out tomorrow

@Lyqyd

Am I missing something?
I was in a rush making this post and had to leave, so I didn't time to get the download yesterday

Vaporware posts occasionally show up talking about a piece of software that doesn't exist or is still being planned. This section is meant for complete code, so I just wanted to make sure there was complete code (even if it hadn't been posted yet). Generally, it'd be a good idea to make sure there's time to put the whole post together.

Oh, and you may wish to loop through the sides provided by rs.getSides() rather than calling each side out individually.
samrg472 #9
Posted 01 July 2012 - 08:58 PM
The Firewall has been added!
Includes a test software so you can test your configuration
Wolvan #10
Posted 02 July 2012 - 01:41 PM
I have an idea how to create HTTP and FTP Servers/Clients. I wrote an API that has functions to send/receive whole files. People could create Servers that host such files, download them and then the Computer shows these files to the users
D3matt #11
Posted 04 July 2012 - 05:17 PM
Funny Sam I seem to recall you telling me you thought my DNS Server was a bad idea and that you didn't see any use for it. Hell, your protocol looks remarkably similar in design and function to mine. Nice job.
samrg472 #12
Posted 04 July 2012 - 08:07 PM
Funny Sam I seem to recall you telling me you thought my DNS Server was a bad idea and that you didn't see any use for it. Hell, your protocol looks remarkably similar in design and function to mine. Nice job.

Lol what? You mad because I made a DNS Server? And 100% of that DNS server code was written by me. So nice job on criticizing. Fail on your part. Fail trolls still failing.
D3matt #13
Posted 07 July 2012 - 12:31 AM
Funny Sam I seem to recall you telling me you thought my DNS Server was a bad idea and that you didn't see any use for it. Hell, your protocol looks remarkably similar in design and function to mine. Nice job.

Lol what? You mad because I made a DNS Server? And 100% of that DNS server code was written by me. So nice job on criticizing. Fail on your part. Fail trolls still failing.
No, I'm mad because you ripped on the idea when I was working on it on your server, then you turn around and do the same thing.
Yurameki #14
Posted 09 July 2012 - 05:10 AM
Does this provide a function to actually send/receive data or commands securely through the rednet? If so is there a bit more documentation?
samrg472 #15
Posted 10 July 2012 - 11:46 PM
Does this provide a function to actually send/receive data or commands securely through the rednet? If so is there a bit more documentation?

This doesn't send commands, as for receiving and sending data you can use the firewall to filter out data, while the dns server simply sends back any data it finds on a certain record.
samrg472 #16
Posted 18 July 2012 - 01:38 AM
Firewall updated to v1.1
Fixed a bug and enhanced a feature
Sxw #17
Posted 19 July 2012 - 11:37 PM
Cool, this might end up as a text wall so ill make a spoiler.
SpoilerMy new plan:
Use xXM0dzXx's paypal thing to be able to "purchase" domain names IG. Mockup, forums might ruin it.
<. /IANA REGISTRATION. >
|. Please choose a domain name. |
|. {cheese.i.like} Status: Available. |
|. DNS ID Record: |
|. {53} Status: ONLINE. |
|. Cost: {$100 per IG year}. |
<. /GO. >
Edit: Yup, forums ruined it.