Skip to content

Instantly share code, notes, and snippets.

@chrisnc
chrisnc / rawudp.go
Last active Apr 18, 2021
constructing ip/udp packets in go
View rawudp.go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
@chrisnc
chrisnc / udp_sock_raw.c
Last active Jul 16, 2018
UDP over SOCK_RAW
View udp_sock_raw.c
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
View TrollMonoid.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Test.QuickCheck
import Data.Monoid
import Data.Word
newtype Troll = Troll Word64
deriving (Eq, Num, Show, Arbitrary)
t :: Troll
View Literals.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleInstances #-}
module Literals
( eval
, env
, expr
, main
) where