dht: add online/offline switching interface