tun.c (31eb07f5f8febab3d68b9d1a350d9e5a4bdf6780) | tun.c (25bd55bbabd8957693c1ffc2fe1bf16cb4fdabd4) |
---|---|
1/* 2 * TUN - Universal TUN/TAP device driver. 3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 192 unchanged lines hidden (view full) --- 201 struct timer_list flow_gc_timer; 202 unsigned long ageing_time; 203 unsigned int numdisabled; 204 struct list_head disabled; 205 void *security; 206 u32 flow_count; 207}; 208 | 1/* 2 * TUN - Universal TUN/TAP device driver. 3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 192 unchanged lines hidden (view full) --- 201 struct timer_list flow_gc_timer; 202 unsigned long ageing_time; 203 unsigned int numdisabled; 204 struct list_head disabled; 205 void *security; 206 u32 flow_count; 207}; 208 |
209static inline bool tun_is_little_endian(struct tun_struct *tun) 210{ 211 return tun->flags & TUN_VNET_LE; 212} 213 |
|
209static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val) 210{ | 214static inline u16 tun16_to_cpu(struct tun_struct *tun, __virtio16 val) 215{ |
211 return __virtio16_to_cpu(tun->flags & TUN_VNET_LE, val); | 216 return __virtio16_to_cpu(tun_is_little_endian(tun), val); |
212} 213 214static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val) 215{ | 217} 218 219static inline __virtio16 cpu_to_tun16(struct tun_struct *tun, u16 val) 220{ |
216 return __cpu_to_virtio16(tun->flags & TUN_VNET_LE, val); | 221 return __cpu_to_virtio16(tun_is_little_endian(tun), val); |
217} 218 219static inline u32 tun_hashfn(u32 rxhash) 220{ 221 return rxhash & 0x3ff; 222} 223 224static struct tun_flow_entry *tun_flow_find(struct hlist_head *head, u32 rxhash) --- 2139 unchanged lines hidden --- | 222} 223 224static inline u32 tun_hashfn(u32 rxhash) 225{ 226 return rxhash & 0x3ff; 227} 228 229static struct tun_flow_entry *tun_flow_find(struct hlist_head *head, u32 rxhash) --- 2139 unchanged lines hidden --- |