当前位置: 首页>>代码示例>>C++>>正文


C++ x25_type_trans函数代码示例

本文整理汇总了C++中x25_type_trans函数的典型用法代码示例。如果您正苦于以下问题:C++ x25_type_trans函数的具体用法?C++ x25_type_trans怎么用?C++ x25_type_trans使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了x25_type_trans函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: x25_asy_bump

static void x25_asy_bump(struct x25_asy *sl)
{
	struct net_device *dev = sl->dev;
	struct sk_buff *skb;
	int count;
	int err;

	count = sl->rcount;
	dev->stats.rx_bytes += count;

	skb = dev_alloc_skb(count+1);
	if (skb == NULL) {
		netdev_warn(sl->dev, "memory squeeze, dropping packet\n");
		dev->stats.rx_dropped++;
		return;
	}
	skb_push(skb, 1);	/* LAPB internal control */
	skb_put_data(skb, sl->rbuff, count);
	skb->protocol = x25_type_trans(skb, sl->dev);
	err = lapb_data_received(skb->dev, skb);
	if (err != LAPB_OK) {
		kfree_skb(skb);
		printk(KERN_DEBUG "x25_asy: data received err - %d\n", err);
	} else {
		netif_rx(skb);
		dev->stats.rx_packets++;
	}
}
开发者ID:Lyude,项目名称:linux,代码行数:28,代码来源:x25_asy.c

示例2: x25_asy_bump

static void x25_asy_bump(struct x25_asy *sl)
{
	struct sk_buff *skb;
	int count;
	int err;

	count = sl->rcount;
	sl->stats.rx_bytes+=count;
	
	skb = dev_alloc_skb(count+1);
	if (skb == NULL)  
	{
		printk("%s: memory squeeze, dropping packet.\n", sl->dev->name);
		sl->stats.rx_dropped++;
		return;
	}
	skb_push(skb,1);	/* LAPB internal control */
	memcpy(skb_put(skb,count), sl->rbuff, count);
	skb->protocol = x25_type_trans(skb, sl->dev);
	if((err=lapb_data_received(skb->dev, skb))!=LAPB_OK)
	{
		kfree_skb(skb);
		printk(KERN_DEBUG "x25_asy: data received err - %d\n",err);
	}
	else
	{
		netif_rx(skb);
		sl->dev->last_rx = jiffies;
		sl->stats.rx_packets++;
	}
}
开发者ID:gnensis,项目名称:linux-2.6.15,代码行数:31,代码来源:x25_asy.c

示例3: x25_data_indication

static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
{
	unsigned char *ptr;

	skb_push(skb, 1);

	if (skb_cow(skb, 1))
		return NET_RX_DROP;

	ptr  = skb->data;
	*ptr = X25_IFACE_DATA;

	skb->protocol = x25_type_trans(skb, dev);
	return netif_rx(skb);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:15,代码来源:hdlc_x25.c

示例4: x25_connect_disconnect

static void x25_connect_disconnect(struct net_device *dev, int reason, int code)
{
	struct sk_buff *skb;
	unsigned char *ptr;

	if ((skb = dev_alloc_skb(1)) == NULL) {
		printk(KERN_ERR "%s: out of memory\n", dev->name);
		return;
	}

	ptr = skb_put(skb, 1);
	*ptr = code;

	skb->protocol = x25_type_trans(skb, dev);
	netif_rx(skb);
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:16,代码来源:hdlc_x25.c

示例5: x25_asy_disconnected

static void x25_asy_disconnected(struct net_device *dev, int reason)
{
	struct x25_asy *sl = dev->priv;
	struct sk_buff *skb;
	unsigned char *ptr;

	if ((skb = dev_alloc_skb(1)) == NULL) {
		printk(KERN_ERR "x25_asy: out of memory\n");
		return;
	}

	ptr  = skb_put(skb, 1);
	*ptr = 0x02;

	skb->protocol = x25_type_trans(skb, sl->dev);
	netif_rx(skb);
}
开发者ID:Mr-Aloof,项目名称:wl500g,代码行数:17,代码来源:x25_asy.c

示例6: x25_asy_disconnected

static void x25_asy_disconnected(struct net_device *dev, int reason)
{
	struct x25_asy *sl = netdev_priv(dev);
	struct sk_buff *skb;
	unsigned char *ptr;

	skb = dev_alloc_skb(1);
	if (skb == NULL) {
		netdev_err(dev, "out of memory\n");
		return;
	}

	ptr  = skb_put(skb, 1);
	*ptr = X25_IFACE_DISCONNECT;

	skb->protocol = x25_type_trans(skb, sl->dev);
	netif_rx(skb);
}
开发者ID:Lyude,项目名称:linux,代码行数:18,代码来源:x25_asy.c


注:本文中的x25_type_trans函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。