Add an IPPrefix::forString parsing function.

This provides a way to parse IP prefixes from strings, and
addresses a TODO. Instead of reusing NetdConstants' parsePrefix
function, which it cannot depend on, it implements the parsing
using the IPAddress class in the same file and standard string
methods.

Bug: 153694684
Test: new unit tests
Original-Change: https://android-review.googlesource.com/1313840
Merged-In: I47b29c8525f3c0236e48b4bb8dbebb223e83bc31
Change-Id: I47b29c8525f3c0236e48b4bb8dbebb223e83bc31
3 files changed