shared/ad: Add function to manipulate flags

This adds basically functionality to manipulate AD flags.
2 files changed