Flag-compatible IP type

Partially addresses #1300  @nictuku