* Receive incoming data on a hook. */
| 502 | * Receive incoming data on a hook. |
| 503 | */ |
| 504 | static int |
| 505 | ng_pptpgre_rcvdata(hook_p hook, item_p item) |
| 506 | { |
| 507 | const hpriv_p hpriv = NG_HOOK_PRIVATE(hook); |
| 508 | int rval; |
| 509 | |
| 510 | /* If not configured, reject */ |
| 511 | if (!hpriv->conf.enabled) { |
| 512 | NG_FREE_ITEM(item); |
| 513 | return (ENXIO); |
| 514 | } |
| 515 | |
| 516 | mtx_lock(&hpriv->mtx); |
| 517 | |
| 518 | rval = ng_pptpgre_xmit(hpriv, item); |
| 519 | |
| 520 | mtx_assert(&hpriv->mtx, MA_NOTOWNED); |
| 521 | |
| 522 | return (rval); |
| 523 | } |
| 524 | |
| 525 | /* |
| 526 | * Hook disconnection |
nothing calls this directly
no test coverage detected