Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vnic_vic.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Cisco Systems, Inc. All rights reserved.
3  *
4  * This program is free software; you may redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
9  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
11  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
12  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
13  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15  * SOFTWARE.
16  *
17  */
18 
19 #ifndef _VNIC_VIC_H_
20 #define _VNIC_VIC_H_
21 
22 /* Note: All integer fields in NETWORK byte order */
23 
24 /* Note: String field lengths include null char */
25 
26 #define VIC_PROVINFO_CISCO_OUI { 0x00, 0x00, 0x0c }
27 #define VIC_PROVINFO_GENERIC_TYPE 0x4
28 
43 };
44 
51 };
52 
53 struct vic_provinfo {
54  u8 oui[3]; /* OUI of data provider */
55  u8 type; /* provider-specific type */
56  u32 length; /* length of data below */
57  u32 num_tlvs; /* number of tlvs */
61  u8 value[0];
62  } tlv[0];
63 } __packed;
64 
65 #define VIC_PROVINFO_ADD_TLV(vp, tlvtype, tlvlen, data) \
66  do { \
67  err = vic_provinfo_add_tlv(vp, tlvtype, tlvlen, data); \
68  if (err) \
69  goto add_tlv_failure; \
70  } while (0)
71 
72 #define VIC_PROVINFO_MAX_DATA 1385
73 #define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \
74  sizeof(struct vic_provinfo))
75 
77  const u8 type);
78 void vic_provinfo_free(struct vic_provinfo *vp);
80  const void *value);
81 size_t vic_provinfo_size(struct vic_provinfo *vp);
82 
83 #endif /* _VNIC_VIC_H_ */