Add two helper functions to conn.[ch].