Lines Matching refs:snap

769 	ipmp_snap_t	*snap;  in ipmp_setqcontext()  local
774 snap = NULL; in ipmp_setqcontext()
778 retval = ipmp_snap_take(statep, &snap); in ipmp_setqcontext()
789 statep->st_snap = snap; in ipmp_setqcontext()
801 ipmp_snap_t *snap; in ipmp_snap_create() local
803 snap = malloc(sizeof (ipmp_snap_t)); in ipmp_snap_create()
804 if (snap == NULL) in ipmp_snap_create()
807 snap->sn_grlistp = NULL; in ipmp_snap_create()
808 snap->sn_grinfolistp = NULL; in ipmp_snap_create()
809 snap->sn_ifinfolistp = NULL; in ipmp_snap_create()
810 snap->sn_adinfolistp = NULL; in ipmp_snap_create()
811 snap->sn_ngroup = 0; in ipmp_snap_create()
812 snap->sn_nif = 0; in ipmp_snap_create()
813 snap->sn_naddr = 0; in ipmp_snap_create()
815 return (snap); in ipmp_snap_create()
822 ipmp_snap_free(ipmp_snap_t *snap) in ipmp_snap_free() argument
828 ipmp_freegrouplist(snap->sn_grlistp); in ipmp_snap_free()
830 for (grlp = snap->sn_grinfolistp; grlp != NULL; grlp = grnext) { in ipmp_snap_free()
836 for (iflp = snap->sn_ifinfolistp; iflp != NULL; iflp = ifnext) { in ipmp_snap_free()
842 for (adlp = snap->sn_adinfolistp; adlp != NULL; adlp = adnext) { in ipmp_snap_free()
848 free(snap); in ipmp_snap_free()
856 ipmp_snap_addgroupinfo(ipmp_snap_t *snap, ipmp_groupinfo_t *grinfop) in ipmp_snap_addgroupinfo() argument
864 if (ipmp_snap_getgroupinfo(snap, grinfop->gr_name) != NULL) in ipmp_snap_addgroupinfo()
872 grlp->grl_next = snap->sn_grinfolistp; in ipmp_snap_addgroupinfo()
873 snap->sn_grinfolistp = grlp; in ipmp_snap_addgroupinfo()
874 snap->sn_ngroup++; in ipmp_snap_addgroupinfo()
884 ipmp_snap_addifinfo(ipmp_snap_t *snap, ipmp_ifinfo_t *ifinfop) in ipmp_snap_addifinfo() argument
892 if (ipmp_snap_getifinfo(snap, ifinfop->if_name) != NULL) in ipmp_snap_addifinfo()
900 iflp->ifl_next = snap->sn_ifinfolistp; in ipmp_snap_addifinfo()
901 snap->sn_ifinfolistp = iflp; in ipmp_snap_addifinfo()
902 snap->sn_nif++; in ipmp_snap_addifinfo()
912 ipmp_snap_addaddrinfo(ipmp_snap_t *snap, ipmp_addrinfo_t *adinfop) in ipmp_snap_addaddrinfo() argument
919 if (ipmp_snap_getaddrinfo(snap, adinfop->ad_group, in ipmp_snap_addaddrinfo()
928 adlp->adl_next = snap->sn_adinfolistp; in ipmp_snap_addaddrinfo()
929 snap->sn_adinfolistp = adlp; in ipmp_snap_addaddrinfo()
930 snap->sn_naddr++; in ipmp_snap_addaddrinfo()
940 ipmp_snap_getgroupinfo(ipmp_snap_t *snap, const char *name) in ipmp_snap_getgroupinfo() argument
944 for (grlp = snap->sn_grinfolistp; grlp != NULL; grlp = grlp->grl_next) { in ipmp_snap_getgroupinfo()
958 ipmp_snap_getifinfo(ipmp_snap_t *snap, const char *name) in ipmp_snap_getifinfo() argument
962 for (iflp = snap->sn_ifinfolistp; iflp != NULL; iflp = iflp->ifl_next) { in ipmp_snap_getifinfo()
976 ipmp_snap_getaddrinfo(ipmp_snap_t *snap, const char *grname, in ipmp_snap_getaddrinfo() argument
981 for (adlp = snap->sn_adinfolistp; adlp != NULL; adlp = adlp->adl_next) { in ipmp_snap_getaddrinfo()
998 ipmp_snap_t *snap, *osnap; in ipmp_snap_take() local
1005 snap = ipmp_snap_create(); in ipmp_snap_take()
1006 if (snap == NULL) in ipmp_snap_take()
1011 ipmp_snap_free(snap); in ipmp_snap_take()
1017 ipmp_snap_free(snap); in ipmp_snap_take()
1041 if (snap->sn_grlistp != NULL) { in ipmp_snap_take()
1045 snap->sn_grlistp = infop; in ipmp_snap_take()
1049 if (snap->sn_nif == osnap->sn_nif) { in ipmp_snap_take()
1061 retval = ipmp_snap_addifinfo(snap, infop); in ipmp_snap_take()
1069 if (snap->sn_naddr == osnap->sn_naddr) { in ipmp_snap_take()
1074 retval = ipmp_snap_addaddrinfo(snap, infop); in ipmp_snap_take()
1082 if (snap->sn_ngroup == osnap->sn_ngroup) { in ipmp_snap_take()
1094 retval = ipmp_snap_addgroupinfo(snap, infop); in ipmp_snap_take()
1109 ipmp_snap_free(snap); in ipmp_snap_take()
1112 } while (snap->sn_grlistp == NULL || snap->sn_nif < osnap->sn_nif || in ipmp_snap_take()
1113 snap->sn_ngroup < osnap->sn_ngroup || in ipmp_snap_take()
1114 snap->sn_naddr < osnap->sn_naddr); in ipmp_snap_take()
1117 *snapp = snap; in ipmp_snap_take()