Showing posts with label gnn. Show all posts
Showing posts with label gnn. Show all posts

Saturday, May 23, 2009

PCS-Current

Working on getting the latest PCS from Hg working, because it will be necessary to have proper Checksum and Length generation on-the-fly for easy generation of valid packets.

Contacted GNN with (hopefully) the last few issues to getting this to work for me.

Zach


Read more...

Monday, May 18, 2009

Adding functionality to PCS

Sent the below to GNN, hopefully it'll make its way into PCS.

def inet_lton(integer):
return struct.pack(">L",integer)

def inet_ltoa(integer):
return socket.inet_ntoa(inet_lton(integer))

def inet_ntol(byteString):
return struct.unpack(">L",byteString)[0]

def inet_atol(ipString):
return inet_ntol(socket.inet_aton(ipString))
Read more...

Tuesday, May 5, 2009

Issues with PCS

Not sure why the below code doesn't print out the same values three times...




import pcs
from pcs.packets.ethernet import *
from pcs.packets.ipv4 import *
from pcs.packets.tcp import *

def main():
from optparse import OptionParser

parser = OptionParser()
parser.add_option("-i", "--interface",
dest="interface", default=None,
help="Which interface to use for testing.")
(options, args) = parser.parse_args()
sniffer = pcs.PcapConnector(options.interface)

while 1:
rawPacket = sniffer.read()
etherPacket = ethernet(rawPacket)

if type(etherPacket.data) == ipv4:
ipv4Packet = ipv4(etherPacket.data.getbytes())

if type(ipv4Packet.data) == tcp:
tcpPacket = tcp(ipv4Packet.data.getbytes())

print etherPacket.data.data
print ipv4Packet.data
print tcpPacket
print '-------------------------------------'
Read more...

Monday, April 20, 2009

GSoC 2009 Acceptance

Google just posted the list of approved student applications, and it looks like mine made it in :-). Hopefully I'll be able to find a blogging client this summer that [1] makes readable HTML and [2] also has decent support for inline code.

Thanks to FreeBSD for being my mentoring organization, and George Neville-Neil for being my mentor. Advance thanks to Prof. Titus Brown for all the hassle I'm about to give him this summer. [/sarcasm?]

More news as it happens.
Read more...

Followers

Blog Archive

About Me