Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / msg / async / dpdk / const.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2 /*
3  * This file is open source software, licensed to you under the terms
4  * of the Apache License, Version 2.0 (the "License").  See the NOTICE file
5  * distributed with this work for additional information regarding copyright
6  * ownership.  You may not use this file except in compliance with the License.
7  *
8  * You may obtain a copy of the License at
9  *
10  *   http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied.  See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 /*
20  * Copyright (C) 2014 Cloudius Systems, Ltd.
21  */
22 /*
23  * Ceph - scalable distributed file system
24  *
25  * Copyright (C) 2015 XSky <haomai@xsky.com>
26  *
27  * Author: Haomai Wang <haomaiwang@gmail.com>
28  *
29  * This is free software; you can redistribute it and/or
30  * modify it under the terms of the GNU Lesser General Public
31  * License version 2.1, as published by the Free Software
32  * Foundation.  See file COPYING.
33  *
34  */
35
36 #ifndef CEPH_MSG_CONST_H_
37 #define CEPH_MSG_CONST_H_
38
39 #include <stdint.h>
40
41 enum class ip_protocol_num : uint8_t {
42   icmp = 1, tcp = 6, unused = 255
43 };
44
45 enum class eth_protocol_num : uint16_t {
46   ipv4 = 0x0800, arp = 0x0806, ipv6 = 0x86dd
47 };
48
49 const uint8_t eth_hdr_len = 14;
50 const uint8_t tcp_hdr_len_min = 20;
51 const uint8_t ipv4_hdr_len_min = 20;
52 const uint8_t ipv6_hdr_len_min = 40;
53 const uint16_t ip_packet_len_max = 65535;
54
55 #endif