My first shot at network coding in C