I need to install some sort of drainage pipe for a washing machine drainage hose to connect to, it appears i have an open pipe to connect to coming out of the wall but not sure what type of connection I would need, looks to be a 40mm push in type connection, not sure if i could just connect a push in 90 degree angle and then have the pipe sticking straight up from there or would i need some sort of p trap underneath, if a p trap is needed there isn't enough room underneath the pipe to fit the trap, can the trap be installed above the pipe?
See attached pictures

