Just following the pattern already set in allocate_ip and deallocate_ip, though I agree a case statement would be better.  Change will be in my next pull request.