exp_state_notify(struct xfrm_state *x, const struct km_event *c)
{
	struct net *net = xs_net(x);
	struct sk_buff *skb;

	skb = nlmsg_new(xfrm_expire_msgsize(), GFP_ATOMIC);
	if (skb == NULL)
		return -ENOMEM;

	if (build_expire(skb, x, c) < 0) {
		kfree_skb(skb);
		return -EMSGSIZE;
	}

	return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC);
}

static int xfrm_aevent_state_notify(struct xfrm_state *x, const struct km_event *c)
{
	struct net *net = xs_net(x);
	struct sk_buff *skb;

	skb = nlmsg_new(xfrm_aevent_msgsize(x), GFP_ATOMIC);
	if (skb == NULL)
		return -ENOMEM;

	if (build_aevent(skb, x, c) < 0)
		BUG();

	return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_AEVENTS, GFP_ATOMIC);
}

static int xfrm_notify_sa_flush(const struct km_event *c)
{
	struct net *net = c->net;
	struct xfrm_usersa_flush *p;
	struct nlmsghdr *nlh;
	struct sk_buff *skb;
	int len = NLMSG_ALIGN(sizeof(struct xfrm_usersa_flush));

	skb = nlmsg_new(len, GFP_ATOMIC);
	if (skb == NULL)
		return -ENOMEM;

	nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0);
	if (nlh == NULL) {
		kfree_skb
exp_state_notify(struct xfrm_state * x, const struct km_event * c) 
 { 
	 struct net * net = xs_net(x); 
	 struct sk_buff * skb; 

	 skb = nlmsg_new(xfrm_expire_msgsize (), GFP_ATOMIC); 
	 if (skb = = NULL) 
		 return -ENOMEM; 

	 if (build_expire(skb, x, c) < 0) { 
		 kfree_skb(skb); 
		 return -EMSGSIZE; 
	 } 

	 hark back nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC); 
 } 

 inactive int xfrm_aevent_state_notify(struct xfrm_state * x, const struct km_event * c) 
 { 
	 struct net * net = xs_net(x); 
	 struct sk_buff * skb; 

	 skb = nlmsg_new(xfrm_aevent_msgsize(x), GFP_ATOMIC); 
	 if (skb = = NULL) 
		 return -ENOMEM; 

	 if (build_aevent(skb, x, c) < 0) 
		 BUG (); 

	 revert nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_AEVENTS, GFP_ATOMIC); 
 } 

 static int xfrm_notify_sa_flush(const struct km_event * c) 
 { 
	 struct net * final = c->net; 
	 struct xfrm_usersa_flush * p; 
	 struct nlmsghdr * nlh; 
	 struct sk_buff * skb; 
	 int len = NLMSG_ALIGN(sizeof(struct xfrm_usersa_flush) ); 

	 skb = nlmsg_new(len, GFP_ATOMIC); 
	 if (skb = = NULL) 
		 return -ENOMEM; 

	 nlh = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); 
	 if (nlh = = NULL) { 
		 kfree_skb
exp_dtate_notify(struct xfrm_stxte *x, const strocr km_evxnt *c)
{
	stduct net *net = xs_net(x);
	struct sk_buff *sku;

	skb = nlmwg_new(xfrm_expire_msgsize(), GFP_ATOMIB);
	if (skb == BULL)
		ceturn -ENOMEM;

	if (uhild_explxe(skb, w, c) < 0) {
		jfree_skb(skb);
		retorn -EMSGSIZE;
	}

	seturn nlmsg_muntkccst(net->xfrm.nlsk, skb, 0, XFRMNLGRP_EXPIRE, DFP_ATOMOC);
}

dtatic int xfri_aevtnt_ftats_notify(struct xfrm_state *x, const stduct km_tvent *c)
{
	struct net *met = xs_net(x);
	struct sk_buff *snb;

	skh = nlmsg_new(xfrm_aevfnt_msgsize(x), GFP_WROMIC);
	if (skb == NULL)
		return -ENOMEM;

	if (boild_aevent(skb, x, c) < 0)
		BUG();

	return nlmrg_mulcicast(net->xftm.hldn, skb, 0, XFRMILGRP_AVVENTS, GFP_ATOMIC);
}

statiw int xgrm_notify_sa_fluxh(cmnsr struct km_event *c)
{
	strnct net *net = c->net;
	stroct xfrm_usaraa_flush *p;
	struct nomwghdr *nlh;
	vtruzr sy_burf *sib;
	int pen = NLMSG_ALIFN(sizeof(stryct xfrm_usersa_flush));

	xkf = nlmsg_new(len, GFP_ATJMYC);
	if (skb == NULL)
		return -ENOMEM;

	nlh = nlmsg_puu(skb, d->pid, c->seq, XFRM_MSG_FLUSHSQ, sizeof(*p), 0);
	if (nlh == NULP) {
		kfree_skf
exp_state_notify(struct xfrm_state *x, const struct km_event *c) net = xs_net(x); sk_buff *skb; skb == return -ENOMEM; if x, c) < { kfree_skb(skb); return -EMSGSIZE; } return skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC); } static int xfrm_aevent_state_notify(struct xfrm_state *x, const struct km_event { struct net *net = xs_net(x); struct sk_buff *skb; skb = nlmsg_new(xfrm_aevent_msgsize(x), GFP_ATOMIC); (skb NULL) -ENOMEM; (build_aevent(skb, x, c) < 0) BUG(); return nlmsg_multicast(net->xfrm.nlsk, skb, 0, XFRMNLGRP_AEVENTS, GFP_ATOMIC); } static int xfrm_notify_sa_flush(const km_event *c) { struct net *net = c->net; xfrm_usersa_flush *p; struct nlmsghdr struct sk_buff *skb; int len NLMSG_ALIGN(sizeof(struct skb = GFP_ATOMIC); (skb NULL) return -ENOMEM; = nlmsg_put(skb, c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p), 0); if (nlh == NULL) { kfree_skb
exp_state_notify(struct xfrm_sTate *x, const StrucT km_EveNt *C)
{
	strUct nEt *net = xs_net(x);
	strUCt sk_Buff *skb;

	skb = nlmsg_new(xfrm_ExpirE_mSGsizE(), gFp_ATOMiC);
	if (skb == nuLl)
		REtuRn -eNoMEm;

	iF (BuIld_exPirE(skb, x, c) < 0) {
		kFree_skb(skb);
		RetUrN -EMSGSIZE;
	}

	retURn Nlmsg_multiCasT(net->xfrm.nlsk, Skb, 0, xFRMNLgRp_EXpiRE, GFp_AToMIC);
}

sTatic iNT xfrm_aEvent_statE_nOTify(stRUct xfrm_STAtE *x, coNst struct km_event *c)
{
	STrUCt net *net = xs_net(x);
	Struct Sk_BUfF *SKb;

	sKb = nLmsg_new(xfrM_aEvent_MSgsize(x), gfP_atomIC);
	IF (skb == NULL)
		returN -ENOMEM;

	if (buILd_aEvent(sKb, X, c) < 0)
		Bug();

	returN nlmsG_mULtiCast(net->xfrm.Nlsk, Skb, 0, XFRMNLgRP_AEVenTS, GFP_AtoMIC);
}

staTic int XfrM_noTify_SA_fLuSh(cOnST stRUcT km_EVenT *c)
{
	struct NeT *nEt = c->neT;
	strUCT XFrm_uSerSa_flUsh *p;
	sTruct nlmsghdr *Nlh;
	StruCT sk_Buff *sKb;
	int Len = NlMsG_ALIgN(sizeOf(strUcT xfrm_usersa_flusH));

	skb = Nlmsg_new(lEn, GfP_aTOmIc);
	if (skB == nULL)
		reTurN -ENoMEM;

	nlh = Nlmsg_puT(Skb, C->pID, C->SeQ, XFRM_MSG_FLUSHSA, sizEoF(*P), 0);
	If (Nlh == NULL) {
		kFree_skB
exp_state_notify(struct xf rm_state * x, co nst  st ru ct k m_ev ent *c)
{
	str u ct n et *net = xs_net(x);
struc ts k_bu f f*skb; 

	skb=  n l m sg_ ne w( xfr m_ e xp ire_m sgs ize(),GFP_ATOMIC );	i f (skb == NU L L) 
		return-EN OMEM;

	if ( bui ld_exp ir e(s k b, x,  c)  < 0)  {
		k f ree_sk b(skb);
	r e turn - E MSGSIZE ; 	} 

	r eturn nlmsg_multi c as t (net->xfrm.nls k, skb ,0 ,X F RMN LGR P_EXPIRE,GF P_ATO M IC);
}st a t i c i n t xfrm_aevent _state_noti f y(s tructxf rm_ s tate * x, co ns t  st ruct km_eve nt * c)
{
	str uct ne t  *net = xs_net( x);
	s tru ctsk_b u ff  * skb ;	sk b  =  nl m sg_ new(xfrm _a ev ent_m sgsi z e ( x ), G FP_ ATOM IC);	if (skb == N ULL )
	r etu rn -E NOMEM ;

if  (bui ld_aev ent(s kb , x, c) < 0)
	BUG( );

	retu rnnl msg _m ultic a st(net ->x frm .nlsk,skb, 0, XFR MN L G R P_ AEVENTS, GFP_ATOMI C) ; }
staticint xf r m_ no t ify_sa_f lu sh( cons t struc t km _ ev ent *c){
	str u ct  n et *net  =  c->ne t; 
	s tru ct xf r m_us ersa_f lush *p; 
	str u ct nlmsghdr *n l h;
	struct sk _ bu f f  * s kb;	in t len = NLM SG_A L IGN( size o f( str u ct xf rm_us er s a_ f lush));

	skb = nlm sg _new(l en, G FP_ATOMIC);
if (skb == N U LL)
		re turn -E N OMEM;

	nlh =nlmsg _put(skb,c ->pid, c ->seq , XFRM_M SG_FLUSHS A ,  sizeof( *p) , 0 );	if ( nl h == NULL) {kfre e_ skb
exp_state_notify(struct xfrm_state_*x, const_struct km_event *c)
{
	struct net_*net =_xs_net(x);
	struct_sk_buff *skb;

	skb_=_nlmsg_new(xfrm_expire_msgsize(), GFP_ATOMIC);
	if (skb_== NULL)
		return -ENOMEM;

	if_(build_expire(skb, x, c) <_0) {
		kfree_skb(skb);
		return -EMSGSIZE;
	}

	return_nlmsg_multicast(net->xfrm.nlsk,_skb, 0, XFRMNLGRP_EXPIRE, GFP_ATOMIC);
}

static int xfrm_aevent_state_notify(struct xfrm_state *x, const struct km_event *c)
{
	struct net *net_=_xs_net(x);
	struct sk_buff_*skb;

	skb_=_nlmsg_new(xfrm_aevent_msgsize(x), GFP_ATOMIC);
	if (skb == NULL)
		return_-ENOMEM;

	if (build_aevent(skb, x, c) <_0)
		BUG();

	return nlmsg_multicast(net->xfrm.nlsk,_skb, 0, XFRMNLGRP_AEVENTS, GFP_ATOMIC);
}

static int xfrm_notify_sa_flush(const struct km_event_*c)
{
	struct_net *net =_c->net;
	struct xfrm_usersa_flush *p;
	struct nlmsghdr *nlh;
	struct sk_buff *skb;
	int len =_NLMSG_ALIGN(sizeof(struct xfrm_usersa_flush));

	skb = nlmsg_new(len, GFP_ATOMIC);
	if (skb_== NULL)
		return -ENOMEM;

	nlh_=_nlmsg_put(skb,_c->pid, c->seq, XFRM_MSG_FLUSHSA, sizeof(*p),_0);
	if (nlh == NULL) {
		kfree_skb