Implementing the Handler and Getting a Handle to the Transaction

The handler function for the plugin’s parent continuation is implemented as follows:

static int
auth_plugin (TSCont contp, TSEvent event, void *edata)
{

     TSHttpTxn txnp = (TSHttpTxn) edata;
     switch (event) {
     case TS_EVENT_HTTP_OS_DNS:
          handle_dns (txnp, contp);
          return 0;
     case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
          handle_response (txnp);
          return 0;
     default:
          break;
     }

     return 0;
}