Hello Donald,
I understood that the way this function was used, was like the other vty conversion functions.
- get afi/safi values
- get afi/safi/vrf values.
meaning that the caller of the function must ensure that the values he passes as params have good initial values.
I would have done a little change.
This is because you handle pointers in that function (*vrf), and you assume that this pointer is valid. Whereas an user that does not want to care about VRF, does not want to initialise a specific value. he uses NULL as parameter.
For that, I would have ignored vrf case ( returned 0 if a vrf is found, and return ok if no vrf is found).
The rest of the series is ok for me.