added secrule structs and add secrule function