add a2_state modle, add api function. add libutil.