1 #ifndef included_vnet_mpls_packet_h
2 #define included_vnet_mpls_packet_h
7 * Copyright (c) 2012 Cisco and/or its affiliates.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at:
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 /* Label: top 20 bits [in network byte order] */
23 /* Experimental: 3 bits ... */
24 /* S (bottom of label stack): 1 bit */
27 } mpls_unicast_header_t;
29 static inline u32 vnet_mpls_uc_get_label (u32 label_exp_s_ttl)
31 return (label_exp_s_ttl>>12);
34 static inline u32 vnet_mpls_uc_get_exp (u32 label_exp_s_ttl)
36 return ((label_exp_s_ttl>>9) & 0x7);
39 static inline u32 vnet_mpls_uc_get_s (u32 label_exp_s_ttl)
41 return ((label_exp_s_ttl>>8) & 0x1);
44 static inline u32 vnet_mpls_uc_get_ttl (u32 label_exp_s_ttl)
46 return (label_exp_s_ttl & 0xff);
49 #endif /* included_vnet_mpls_packet_h */