On Tue, Mar 19, 2019 at 10:18:00AM +0000, Petr Machata wrote: > Stephen Hemminger <step...@networkplumber.org> writes: > > Gut feel is that enumerated values are going to grow and grow and be > > long term API headache. > > > > Would it be possible to use a string like the external ack error > > message? > > It would, but then if any automated tools want to make use of it beyond > just blindly displaying it, they will need to parse it with all the > usual problems. In the end the string itself becomes the API anyway.
Providing only text description doesn't sound right to me either, I would rather prefer having both text and numeric code in such case. > Adding a string would make sense as an extra piece of information, not > as the primary channel. Extack is like this as well, the primary channel > there is errno. Not exactly, the primary goal of extack was IMHO to provide better granularity than the standard error codes allowed (we all remember the cryptic messages of older iproute2 versions). A better analogy would be numeric error codes which could be passed via extack cookie (e.g. nl_set_extack_cookie_u64()) together with a text representation. But AFAIK only few netlink based interfaces use those. Michal Kubecek