To expand a bit, the SMB parser would register a callback to retrieve this state + version.

Maybe it would be cleaner to have something like:
new_alproto = GetNestedState(alproto, alstate, &new_alstate);
if (new_alproto == ALPROTO_UNKNOW)
   HandleError();