Implement enum attrs and use them for port types

Signed-off-by: Guillermo Ontanon <guillermo@midokura.jp>