* Prepend a possibly compressed PPP protocol number in front of a frame */
| 2415 | * Prepend a possibly compressed PPP protocol number in front of a frame |
| 2416 | */ |
| 2417 | static struct mbuf * |
| 2418 | ng_ppp_addproto(struct mbuf *m, uint16_t proto, int compOK) |
| 2419 | { |
| 2420 | if (compOK && PROT_COMPRESSABLE(proto)) { |
| 2421 | uint8_t pbyte = (uint8_t)proto; |
| 2422 | |
| 2423 | return ng_ppp_prepend(m, &pbyte, 1); |
| 2424 | } else { |
| 2425 | uint16_t pword = htons((uint16_t)proto); |
| 2426 | |
| 2427 | return ng_ppp_prepend(m, &pword, 2); |
| 2428 | } |
| 2429 | } |
| 2430 | |
| 2431 | /* |
| 2432 | * Cut a possibly compressed PPP protocol number from the front of a frame. |
no test coverage detected