OpenNSL API Guide and Reference Manual
Welcome
OpenNSL Documentation
API Reference
Files
File List
Globals
include
opennsl
pkt.h
Go to the documentation of this file.
1
4
/*****************************************************************************
5
*
6
* (C) Copyright Broadcom Corporation 2013-2016
7
*
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
*
11
* You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
13
*
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.
19
*
20
***************************************************************************/
24
#ifndef __OPENNSL_PKT_H__
25
#define __OPENNSL_PKT_H__
26
27
#include <
shared/rx.h
>
28
#include <
opennsl/types.h
>
29
#include <
opennsl/vlan.h
>
30
59
typedef
struct
opennsl_pkt_s
opennsl_pkt_t
;
60
61
typedef
void (*
opennsl_pkt_cb_f
)(
62
int
reserved1
,
63
opennsl_pkt_t
*
reserved2
,
64
void
*
reserved3
);
65
67
typedef
struct
opennsl_pkt_blk_s
{
68
uint8
*
data
;
69
int
len
;
70
}
opennsl_pkt_blk_t
;
71
/* __doxy_func_body_end__ */
72
74
typedef
_shr_rx_reasons_t
opennsl_rx_reasons_t
;
75
77
typedef
struct
opennsl_pkt_oam_counter_s
{
78
opennsl_reserved_enum_t
reserved1
;
79
uint32
reserved2
;
80
uint32
reserved3
;
81
opennsl_reserved_enum_t
reserved4
;
82
uint32
reserved5
;
83
uint32
reserved6
;
84
uint32
reserved7
;
85
}
opennsl_pkt_oam_counter_t
;
86
/* __doxy_func_body_end__ */
87
88
#define OPENNSL_PKT_OAM_COUNTER_MAX 3
89
#define OPENNSL_PKT_NOF_DNX_HEADERS _SHR_PKT_NOF_DNX_HEADERS
90
91
struct
opennsl_pkt_s
{
92
opennsl_pkt_blk_t
*
pkt_data
;
93
uint8
blk_count
;
94
uint8
unit
;
95
uint8
cos
;
96
uint8
reserved1
;
97
opennsl_vlan_t
vlan
;
98
uint8
reserved2
;
99
uint8
reserved3
;
100
opennsl_vlan_t
reserved4
;
101
uint8
reserved5
;
102
uint8
reserved6
;
103
opennsl_color_t
reserved7
;
104
int16
src_port
;
105
opennsl_trunk_t
reserved8
;
106
uint16
reserved9
;
107
uint16
dest_port
;
108
uint16
reserved10
;
109
uint8
reserved11
;
110
opennsl_gport_t
reserved12
;
111
opennsl_gport_t
reserved13
;
112
opennsl_multicast_t
reserved14
;
113
uint32
reserved15
;
114
opennsl_reserved_enum_t
reserved16
;
115
uint32
reserved17
;
116
uint32
reserved18
;
117
uint32
reserved19
;
118
uint32
reserved20
;
119
opennsl_if_t
reserved21
;
120
uint16
pkt_len
;
121
uint16
tot_len
;
123
opennsl_pbmp_t
tx_pbmp
;
124
opennsl_pbmp_t
tx_upbmp
;
125
opennsl_pbmp_t
reserved22
;
126
opennsl_port_t
reserved23
;
127
uint8
reserved24
;
128
uint32
rx_reason
;
129
opennsl_rx_reasons_t
rx_reasons
;
130
uint32
reserved25
;
131
uint8
reserved26
;
132
uint8
rx_port
;
133
uint8
reserved27
;
134
uint8
rx_untagged
;
135
uint32
reserved28
;
136
uint32
rx_matched
;
137
opennsl_if_t
reserved29
;
138
opennsl_vlan_action_t
reserved30
;
139
opennsl_vlan_action_t
reserved31
;
140
uint32
reserved32
;
141
uint32
reserved33
;
142
uint32
reserved34
;
143
void
*
reserved35
;
144
void
*
reserved36
;
145
opennsl_pkt_cb_f
call_back
;
146
uint32
flags
;
147
void
*
reserved37
;
148
int8
reserved38
;
149
opennsl_pkt_blk_t
_pkt_data
;
150
opennsl_pkt_t
*
reserved39
;
151
void
*
reserved40
;
152
int8
reserved41
;
153
opennsl_pkt_t
*
reserved42
;
154
void
*
reserved43
;
155
void
*
reserved44
;
156
uint8
reserved45
[16];
157
uint8
reserved46
[12];
158
uint8
reserved47
[4];
159
uint8
_vtag
[4];
161
uint8
reserved48
[16];
162
uint8
reserved49
;
163
uint8
reserved50
[10];
164
int
reserved51
;
165
int
reserved52
;
166
uint32
reserved53
;
167
opennsl_pbmp_t
reserved54
;
168
opennsl_pbmp_t
reserved55
;
169
uint32
reserved56
;
170
uint8
reserved57
;
171
uint8
reserved58
;
172
uint16
reserved59
;
173
uint32
reserved60
;
174
void
*
reserved61
;
175
uint16
reserved62
;
176
uint16
reserved63
;
177
opennsl_reserved_enum_t
reserved64
;
178
opennsl_reserved_enum_t
reserved65
;
179
opennsl_reserved_enum_t
reserved66
;
180
uint8
reserved67
;
181
opennsl_reserved_enum_t
reserved68
;
182
opennsl_gport_t
reserved69
;
183
opennsl_gport_t
reserved70
;
184
uint32
reserved71
;
185
int
snoop_cmnd
;
186
opennsl_gport_t
reserved72
;
187
uint32
reserved73
;
188
uint32
reserved74
;
189
uint8
reserved75
;
190
opennsl_reserved_enum_t
reserved76
;
191
opennsl_pkt_oam_counter_t
reserved77
[
OPENNSL_PKT_OAM_COUNTER_MAX
];
192
uint32
reserved78
;
193
uint8
reserved79
[20];
194
uint8
reserved80
;
195
uint8
reserved81
[4];
196
void
*
reserved82
;
197
uint8
reserved83
;
198
uint8
reserved84
;
199
uint8
reserved85
;
200
uint8
reserved86
;
201
uint16
reserved87
;
202
uint16
reserved88
;
203
uint16
reserved89
;
204
uint8
reserved90
;
205
uint16
reserved91
;
206
};
207
/* __doxy_func_body_end__ */
208
209
#define OPENNSL_PKT_F_NO_VTAG 0x4
210
#define OPENNSL_TX_CRC_ALLOC 0x10
211
#define OPENNSL_TX_CRC_REGEN 0x20
212
#define OPENNSL_TX_CRC_APPEND (OPENNSL_TX_CRC_ALLOC + OPENNSL_TX_CRC_REGEN)
213
#define OPENNSL_TX_ETHER 0x100000
214
#define OPENNSL_PKT_F_TRUNK 0x20000000
215
#define OPENNSL_PKT_ONE_BUF_SETUP(pkt, buf, _len) \
216
do { \
217
(pkt)->_pkt_data.data = (buf); \
218
(pkt)->_pkt_data.len = (_len); \
219
(pkt)->pkt_data = &(pkt)->_pkt_data; \
220
(pkt)->blk_count = 1; \
221
} while (0)
222
/* __doxy_func_body_end__ */
223
/***************************************************************************/
245
extern
int
opennsl_pkt_clear
(
246
int
unit,
247
opennsl_pkt_t
*pkt,
248
opennsl_pkt_blk_t
*blks,
249
int
blk_count,
250
uint32
flags,
251
opennsl_pkt_t
**pkt_buf)
LIB_DLL_EXPORTED
;
252
253
/***************************************************************************/
265
extern
int
opennsl_pkt_flags_init
(
266
int
unit,
267
opennsl_pkt_t
*pkt,
268
uint32
init_flags)
LIB_DLL_EXPORTED
;
269
270
/***************************************************************************/
289
extern
int
opennsl_pkt_memcpy
(
290
opennsl_pkt_t
*pkt,
291
int
dest_byte,
292
uint8
*src,
293
int
len)
LIB_DLL_EXPORTED
;
294
295
/***************************************************************************/
316
extern
int
opennsl_pkt_alloc
(
317
int
unit,
318
int
size,
319
uint32
flags,
320
opennsl_pkt_t
**pkt_buf)
LIB_DLL_EXPORTED
;
321
322
/***************************************************************************/
341
extern
int
opennsl_pkt_free
(
342
int
unit,
343
opennsl_pkt_t
*pkt)
LIB_DLL_EXPORTED
;
344
345
/***************************************************************************/
359
extern
void
opennsl_pkt_t_init
(
360
opennsl_pkt_t
*pkt)
LIB_DLL_EXPORTED
;
361
362
/***************************************************************************/
378
extern
void
opennsl_pkt_blk_t_init
(
379
opennsl_pkt_blk_t
*pkt_blk)
LIB_DLL_EXPORTED
;
380
381
/***************************************************************************/
395
extern
void
opennsl_rx_reasons_t_init
(
396
opennsl_rx_reasons_t
*reasons)
LIB_DLL_EXPORTED
;
397
398
#include <
opennsl/pktX.h
>
399
#endif
/* __OPENNSL_PKT_H__ */
400
© 2016-17 by Broadcom Limited. All rights reserved.