| | 1226 | /** Skips over any MPLS headers, if present. |
|---|
| | 1227 | * @param ethernet_payload A pointer to the payload following an ethernet |
|---|
| | 1228 | * header - usually the result of calling trace_get_payload_from_link |
|---|
| | 1229 | * @param[in,out] type The ethernet type, replaced by the ether type of the |
|---|
| | 1230 | * following header - 0x0000 if an Ethernet header is deemed to be next |
|---|
| | 1231 | * @param[in,out] remaining Updated with the number of bytes remaining |
|---|
| | 1232 | * |
|---|
| | 1233 | * @return a pointer to the header beyond the MPLS label, if present. Will |
|---|
| | 1234 | * return NULL if there is not enough bytes remaining to skip past the MPLS |
|---|
| | 1235 | * label or if the ether type is not MPLS. |
|---|
| | 1236 | * |
|---|
| | 1237 | * Remaining may be NULL. If remaining is not NULL it must point to the number |
|---|
| | 1238 | * of bytes captured past (but not including) the link layer. This function |
|---|
| | 1239 | * will decrement it by the length of the topmost MPLS label if present. |
|---|
| | 1240 | * |
|---|
| | 1241 | * Type must point to the value of the ethernet type. Libtrace will assert |
|---|
| | 1242 | * fail if type is NULL. |
|---|
| | 1243 | * |
|---|
| | 1244 | * NOTE that this function will only remove one MPLS label at a time - the type |
|---|
| | 1245 | * will be set to 0x8847 if there is another MPLS label after the one |
|---|
| | 1246 | * removed by this function. |
|---|
| | 1247 | * |
|---|
| | 1248 | */ |
|---|
| | 1249 | DLLEXPORT void *trace_get_mpls_payload_from_ethernet_payload( |
|---|
| | 1250 | void *ethernet_payload, uint16_t *type, uint32_t *remaining); |
|---|
| | 1251 | |
|---|