]> git.proxmox.com Git - ovs.git/blame - datapath/vlan.c
ovsdb: Don't check "date" before assignment in ovsdb_file_txn_from_json().
[ovs.git] / datapath / vlan.c
CommitLineData
6e0ce48e
JG
1/*
2 * Copyright (c) 2011 Nicira Networks.
3 * Distributed under the terms of the GNU GPL version 2.
4 *
5 * Significant portions of this file may be copied from parts of the Linux
6 * kernel, by Linus Torvalds and others.
7 */
8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10
11#include <linux/if_vlan.h>
12#include <linux/skbuff.h>
13
14#include "datapath.h"
15#include "vlan.h"
16
17#ifdef NEED_VLAN_FIELD
18void vlan_copy_skb_tci(struct sk_buff *skb)
19{
20 OVS_CB(skb)->vlan_tci = 0;
21}
22
23u16 vlan_get_tci(struct sk_buff *skb)
24{
25 return OVS_CB(skb)->vlan_tci;
26}
27
28void vlan_set_tci(struct sk_buff *skb, u16 vlan_tci)
29{
30 OVS_CB(skb)->vlan_tci = vlan_tci;
31}
32
33bool vlan_tx_tag_present(struct sk_buff *skb)
34{
35 return OVS_CB(skb)->vlan_tci & VLAN_TAG_PRESENT;
36}
37
38u16 vlan_tx_tag_get(struct sk_buff *skb)
39{
40 return OVS_CB(skb)->vlan_tci & ~VLAN_TAG_PRESENT;
41}
42
43struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, u16 vlan_tci)
44{
45 OVS_CB(skb)->vlan_tci = vlan_tci | VLAN_TAG_PRESENT;
46 return skb;
47}
48#endif /* NEED_VLAN_FIELD */