Added trap routines

Added routines to be able to sent traps.