Lines Matching refs:cp

149 struct ip_vs_app * ip_vs_bind_app(struct ip_vs_conn *cp)  in ip_vs_bind_app()  argument
154 if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) in ip_vs_bind_app()
157 if (cp->protocol != IPPROTO_TCP && cp->protocol != IPPROTO_UDP) in ip_vs_bind_app()
163 if (cp->app != NULL) { in ip_vs_bind_app()
166 return cp->app; in ip_vs_bind_app()
169 vapp = ip_vs_app_get(cp->protocol, cp->vport); in ip_vs_bind_app()
172 cp->app = vapp; in ip_vs_bind_app()
175 vapp->init_conn(vapp, cp); in ip_vs_bind_app()
184 int ip_vs_unbind_app(struct ip_vs_conn *cp) in ip_vs_unbind_app() argument
186 struct ip_vs_app *vapp = cp->app; in ip_vs_unbind_app()
188 if (cp->protocol != IPPROTO_TCP && cp->protocol != IPPROTO_UDP) in ip_vs_unbind_app()
193 vapp->done_conn(vapp, cp); in ip_vs_unbind_app()
194 cp->app = NULL; in ip_vs_unbind_app()
263 static inline void vs_seq_update(struct ip_vs_conn *cp, struct ip_vs_seq *vseq, in vs_seq_update() argument
267 spin_lock(&cp->lock); in vs_seq_update()
268 if ( !(cp->flags & flag) || after(seq, vseq->init_seq)) { in vs_seq_update()
272 cp->flags |= flag; in vs_seq_update()
274 spin_unlock(&cp->lock); in vs_seq_update()
283 int ip_vs_app_pkt_out(struct ip_vs_conn *cp, struct sk_buff *skb) in ip_vs_app_pkt_out() argument
295 if ((vapp = cp->app) == NULL) in ip_vs_app_pkt_out()
309 if (cp->protocol == IPPROTO_TCP) { in ip_vs_app_pkt_out()
310 if (cp->flags & IP_VS_CONN_F_OUT_SEQ) in ip_vs_app_pkt_out()
311 vs_fix_seq(&cp->out_seq, th); in ip_vs_app_pkt_out()
312 if (cp->flags & IP_VS_CONN_F_IN_SEQ) in ip_vs_app_pkt_out()
313 vs_fix_ack_seq(&cp->in_seq, th); in ip_vs_app_pkt_out()
322 diff = vapp->pkt_out(vapp, cp, skb); in ip_vs_app_pkt_out()
327 if (diff != 0 && cp->protocol == IPPROTO_TCP) in ip_vs_app_pkt_out()
328 vs_seq_update(cp, &cp->out_seq, in ip_vs_app_pkt_out()
340 int ip_vs_app_pkt_in(struct ip_vs_conn *cp, struct sk_buff *skb) in ip_vs_app_pkt_in() argument
352 if ((vapp = cp->app) == NULL) in ip_vs_app_pkt_in()
366 if (cp->protocol == IPPROTO_TCP) { in ip_vs_app_pkt_in()
367 if (cp->flags & IP_VS_CONN_F_IN_SEQ) in ip_vs_app_pkt_in()
368 vs_fix_seq(&cp->in_seq, th); in ip_vs_app_pkt_in()
369 if (cp->flags & IP_VS_CONN_F_OUT_SEQ) in ip_vs_app_pkt_in()
370 vs_fix_ack_seq(&cp->out_seq, th); in ip_vs_app_pkt_in()
379 diff = vapp->pkt_in(vapp, cp, skb); in ip_vs_app_pkt_in()
384 if (diff != 0 && cp->protocol == IPPROTO_TCP) in ip_vs_app_pkt_in()
385 vs_seq_update(cp, &cp->in_seq, in ip_vs_app_pkt_in()