router/hipache: implemented swap.
router: refactored swap.