本文整理汇总了C++中dst_output函数的典型用法代码示例。如果您正苦于以下问题:C++ dst_output函数的具体用法?C++ dst_output怎么用?C++ dst_output使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dst_output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ip_local_out
int ip_local_out(struct sk_buff *skb)
{
int err;
err = __ip_local_out(skb);
if (likely(err == 1))
err = dst_output(skb);
return err;
}
示例2: ipsec_mast_xmit2
static inline int ipsec_mast_xmit2(struct sk_buff *skb)
{
#ifdef NET_26 /* 2.6 kernels */
return dst_output(skb);
#else
return ip_send(skb);
#endif
}
示例3: ip_forward_finish
static int ip_forward_finish(struct sk_buff *skb)
{
struct ip_options *opt = &(IPCB(skb)->opt);
IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS);
IP_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTOCTETS, skb->len);
if (unlikely(opt->optlen))
ip_forward_options(skb);
return dst_output(skb);
}
示例4: vrf_ip_local_out
/* based on ip_local_out; can't use it b/c the dst is switched pointing to us */
static int vrf_ip_local_out(struct net *net, struct sock *sk,
struct sk_buff *skb)
{
int err;
err = nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, net, sk,
skb, NULL, skb_dst(skb)->dev, dst_output);
if (likely(err == 1))
err = dst_output(net, sk, skb);
return err;
}
示例5: ip_forward_finish
static int ip_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct ip_options *opt = &(IPCB(skb)->opt);
__IP_INC_STATS(net, IPSTATS_MIB_OUTFORWDATAGRAMS);
__IP_ADD_STATS(net, IPSTATS_MIB_OUTOCTETS, skb->len);
if (unlikely(opt->optlen))
ip_forward_options(skb);
return dst_output(net, sk, skb);
}
示例6: xfrm4_output_finish
int xfrm4_output_finish(struct sk_buff *skb)
{
#ifdef CONFIG_NETFILTER
if (!skb_dst(skb)->xfrm) {
IPCB(skb)->flags |= IPSKB_REROUTED;
return dst_output(skb);
}
IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED;
#endif
skb->protocol = htons(ETH_P_IP);
return xfrm_output(skb);
}
示例7: ipv6_local_out
s32 ipv6_local_out(struct sk_buff **skb, struct net_device *outdev)
{
s32 ret = 0;
u32 verdict;
verdict = ipv6_defrag(NF_IP6_LOCAL_OUT, skb, NULL, outdev, dst_output);
TSE6_CHECK_RET(verdict, ret, local_out, *skb);
verdict = ipv6_session_in(NF_IP6_LOCAL_OUT, skb, outdev);
TSE6_CHECK_RET(verdict, ret, local_out, *skb);
local_out:
TSESSION6_DEBUG(TSESSION6_DEBUG_CHAIN, "ipv6_local_out ret:%d\n", ret);
if (1 == ret)
ret = dst_output(*skb);
return ret;
}
示例8: __ip_local_out
int __ip_local_out(struct sk_buff *skb)
{
struct iphdr *iph = ip_hdr(skb);
iph->tot_len = htons(skb->len);
ip_send_check(iph);
#if defined(CONFIG_RTL_USB_IP_HOST_SPEEDUP)
if(isUsbIp_Reserved(skb, NF_INET_LOCAL_OUT, 1)==0){
return nf_hook(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, skb->dst->dev,dst_output);
}else{
return dst_output(skb);
}
#else
return nf_hook(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, skb->dst->dev,
dst_output);
#endif
}
示例9: __ip_local_out
int __ip_local_out(struct sk_buff *skb)
{
struct iphdr *iph = ip_hdr(skb);
#if IS_ENABLED(CONFIG_RA_HW_NAT)
FOE_AI_UNHIT(skb);
#endif
iph->tot_len = htons(skb->len);
ip_send_check(iph);
#if defined(CONFIG_NETFILTER_FP_SMB)
if ((skb->nf_fp_cache & NF_FP_CACHE_SMB) || nf_fp_smb_hook_out(skb))
return dst_output(skb);
#endif
return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, skb, NULL,
skb_dst(skb)->dev, dst_output);
}
示例10: ns_nat64_xmit
unsigned int ns_nat64_xmit(struct sk_buff *skb)
{
struct rtable *rp;
s32 ret;
NAT64_DEBUG(NAT64_DEBUG_XMIT, "ns_nat64_xmit() enter\n");
NAT64_DEBUG(NAT64_DEBUG_XMIT, "skb->protocal : %x\n", skb->protocol);
if (skb->protocol == htons(ETH_P_IP))
{
struct iphdr *iph = skb->nh.iph;
struct flowi fl = {
.nl_u = {
.ip4_u = {
.daddr = iph->daddr,
.saddr = iph->saddr,
.tos = iph->tos,
},
},
};
NAT64_DEBUG(NAT64_DEBUG_XMIT, "iph->daddr:%08x, iph->saddr:%08x, iph->tos:%x\n", iph->daddr, iph->saddr, iph->tos);
ret = ip_route_output_key(if_dev_vrf(skb->dev), if_dev_litevrf_id(skb->dev), &rp, &fl);
NAT64_DEBUG(NAT64_DEBUG_XMIT, "ip_route_output_key() return %d\n", ret);
if (ret)
goto drop;
ip_decrease_ttl(iph);
NAT64_DEBUG(NAT64_DEBUG_XMIT, "iph->ttl %d, rp->rt_flags : %x\n", iph->ttl, rp->rt_flags);
ns_ff_set_flag(skb, NS_FF_L3);
if(!(rp->rt_flags & RTCF_LOCAL))
{
skb->dst = &(rp->u.dst);
dst_output(skb);
goto quit;
}
else
{
dst_release(&rp->u.dst);
goto drop;
}
}
else if (skb->protocol == htons(ETH_P_IPV6))
示例11: __xfrm6_output
static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct dst_entry *dst = skb_dst(skb);
struct xfrm_state *x = dst->xfrm;
int mtu;
bool toobig;
#ifdef CONFIG_NETFILTER
if (!x) {
IP6CB(skb)->flags |= IP6SKB_REROUTED;
return dst_output(net, sk, skb);
}
#endif
if (x->props.mode != XFRM_MODE_TUNNEL)
goto skip_frag;
if (skb->protocol == htons(ETH_P_IPV6))
mtu = ip6_skb_dst_mtu(skb);
else
mtu = dst_mtu(skb_dst(skb));
toobig = skb->len > mtu && !skb_is_gso(skb);
if (toobig && xfrm6_local_dontfrag(skb)) {
xfrm6_local_rxpmtu(skb, mtu);
kfree_skb(skb);
return -EMSGSIZE;
} else if (!skb->ignore_df && toobig && skb->sk) {
xfrm_local_error(skb, mtu);
kfree_skb(skb);
return -EMSGSIZE;
}
if (toobig || dst_allfrag(skb_dst(skb)))
return ip6_fragment(net, sk, skb,
__xfrm6_output_finish);
skip_frag:
return x->outer_mode->afinfo->output_finish(sk, skb);
}
示例12: dn_nsp_do_disc
static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
unsigned short reason, gfp_t gfp,
struct dst_entry *dst,
int ddl, unsigned char *dd, __le16 rem, __le16 loc)
{
struct sk_buff *skb = NULL;
int size = 7 + ddl + ((msgflg == NSP_DISCINIT) ? 1 : 0);
unsigned char *msg;
if ((dst == NULL) || (rem == 0)) {
if (net_ratelimit())
printk(KERN_DEBUG "DECnet: dn_nsp_do_disc: BUG! Please report this to [email protected] rem=%u dst=%p\n", le16_to_cpu(rem), dst);
return;
}
if ((skb = dn_alloc_skb(sk, size, gfp)) == NULL)
return;
msg = skb_put(skb, size);
*msg++ = msgflg;
*(__le16 *)msg = rem;
msg += 2;
*(__le16 *)msg = loc;
msg += 2;
*(__le16 *)msg = cpu_to_le16(reason);
msg += 2;
if (msgflg == NSP_DISCINIT)
*msg++ = ddl;
if (ddl) {
memcpy(msg, dd, ddl);
}
/*
* This doesn't go via the dn_nsp_send() function since we need
* to be able to send disc packets out which have no socket
* associations.
*/
skb_dst_set(skb, dst_clone(dst));
dst_output(skb);
}
示例13: xfrm4_output_finish
static int xfrm4_output_finish(struct sk_buff *skb)
{
struct sk_buff *segs;
#ifdef CONFIG_NETFILTER
if (!skb->dst->xfrm) {
IPCB(skb)->flags |= IPSKB_REROUTED;
return dst_output(skb);
}
#endif
if (!skb_is_gso(skb))
return xfrm4_output_finish2(skb);
skb->protocol = htons(ETH_P_IP);
segs = skb_gso_segment(skb, 0);
kfree_skb(skb);
if (unlikely(IS_ERR(segs)))
return PTR_ERR(segs);
do {
struct sk_buff *nskb = segs->next;
int err;
segs->next = NULL;
err = xfrm4_output_finish2(segs);
if (unlikely(err)) {
while ((segs = nskb)) {
nskb = segs->next;
segs->next = NULL;
kfree_skb(segs);
}
return err;
}
segs = nskb;
} while (segs);
return 0;
}
示例14: mpls_forward
s32 mpls_forward(struct sk_buff*skb)
{
struct ip_options * opt = &(IPCB(skb)->opt);
MPLS_DEBUG_FORWARD("Entry mpls_forward.\n ");
MPLS_DEBUG_COUNTER_INC(mpls_forward);
if (FF_ENABLE)
{
/*Mpls not support fast route now, so, set linux forward flag.*/
skb->ff_flag = ff_set_flag(skb, DRV_FF_FLAG_LINUX_FORWARD);
}
IP_INC_STATS_BH(if_dev_vrf(skb->dst->dev), IPSTATS_MIB_OUTFORWDATAGRAMS);
if (unlikely(opt->optlen))
ip_forward_options(skb);
return dst_output(skb);
}
示例15: ip_forward_finish
static int ip_forward_finish(struct sk_buff *skb)
{
struct ip_options * opt = &(IPCB(skb)->opt);
IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS);
if (unlikely(opt->optlen))
ip_forward_options(skb);
#ifdef CONFIG_NET_GIANFAR_FP
else {
struct rtable *rt = skb_rtable(skb);
#ifdef FASTPATH_DEBUG
if (printk_ratelimit())
printk(KERN_INFO" %s: rt = %p, rt->rt_flags = %x "
"(fast=%x), netdev_fastroute_ob=%d\n",
__func___, rt, rt ? rt->rt_flags : 0,
RTCF_FAST, netdev_fastroute_obstacles);
#endif
if ((rt->rt_flags & RTCF_FAST) && !netdev_fastroute_obstacles) {
struct dst_entry *old_dst;
unsigned h = gfar_fastroute_hash(*(u8 *)&rt->rt_dst,
*(u8 *)&rt->rt_src);
#ifdef FASTPATH_DEBUG
if (printk_ratelimit())
printk(KERN_INFO " h = %d (%d, %d)\n",
h, rt->rt_dst, rt->rt_src);
#endif
write_lock_irq(&skb->dev->fastpath_lock);
old_dst = skb->dev->fastpath[h];
skb->dev->fastpath[h] = dst_clone(&rt->u.dst);
write_unlock_irq(&skb->dev->fastpath_lock);
dst_release(old_dst);
}
}
#endif
return dst_output(skb);
}