Import of code from c-tap-harness