Skip to content

Instantly share code, notes, and snippets.

View AndreaCrotti's full-sized avatar

Andrea Crotti AndreaCrotti

View GitHub Profile
#include "routing.h"
// initialize the routing structure to do it directly from here
int routing_init(struct config *c, char *tun_name) {
FILE *fd;
char buf[256];
my_short_addr = ntohs(__my_address.s6_addr16[7]);
strncpy(proxy_dev, c->proxy_dev, IFNAMSIZ);
strncpy(tun_dev, tun_name, IFNAMSIZ);
<ul id="mainmenu">
<li class="first"><a href="${tg.url('/')}"> ${_("List")} </a></li>
<li class="first"><a href="${tg.url('/new_person')}"> ${_("New Person")} </a> </li>
<li class="first"><a href="${tg.url('/new_firm')}"> ${_("New Firm")} </a> </li>
</ul>
# -*- coding: utf-8 -*-
"""The application's model objects"""
import elixir
from zope.sqlalchemy import ZopeTransactionExtension
from sqlalchemy.orm import scoped_session, sessionmaker
#from sqlalchemy import MetaData
from sqlalchemy.ext.declarative import declarative_base
.coverage
BeautifulSoup-3.1.0.1-py2.6.egg
MANIFEST.in
devdata.db
dist/ldapper-0.1dev-py2.6.egg
ez_setup/README.txt
ez_setup/__init__.py
ldapper.egg-info/PKG-INFO
ldapper.egg-info/SOURCES.txt
ldapper.egg-info/dependency_links.txt
Untracked files:
.coverage
BeautifulSoup-3.1.0.1-py2.6.egg
MANIFEST.in
devdata.db
dist/ldapper-0.1dev-py2.6.egg
ez_setup/README.txt
ez_setup/__init__.py
ldapper.egg-info/PKG-INFO
ldapper.egg-info/SOURCES.txt
// -*- compile-command: "gcc -Wall chunker.c -o chunker" -*-
// TODO: add one End Of Packet packet which means end of transmission for packet with seq_no
// TODO: check integer division
// TODO: send the raw packets generated via the tun device
// TODO: use perror to print out errors when possible
// TODO: set first the packet to all 0 and only set the needed fields
#include <stdlib.h>
#include <stdio.h>
#include <netinet/ip6.h>
#include <stdlib.h>
#include <stdio.h>
#include <netinet/ip6.h>
#include <stdint.h>
#include <string.h>
#include <sys/socket.h>
#include <assert.h>
// measures in bytes
#define SIZE_IPV6_HEADER 40
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/if.h>
#include <linux/if_tun.h>
// see http://www.zlib.net/manual.html for more info
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "../shared/structs.h"
#include "zlib.h"
/* see if the dimension is important or not */
#define LEVEL Z_BEST_COMPRESSION
#!/usr/bin/env python
"""
Take some data, send it to the device
TODO: make the compression an option which could be also disabled
TODO: setup a nice logger
"""
# from TOSSIM import Tossim, SerialForwarder, Throttle
import os
import zlib