+ av_type = PW_NAS_ERROR;
+ switch( status ) {
+ case EXIT_OK:
+ case EXIT_USER_REQUEST:
+ av_type = PW_USER_REQUEST;
+ break;
+
+ case EXIT_HANGUP:
+ case EXIT_PEER_DEAD:
+ case EXIT_CONNECT_FAILED:
+ av_type = PW_LOST_CARRIER;
+ break;
+
+ case EXIT_INIT_FAILED:
+ case EXIT_OPEN_FAILED:
+ case EXIT_LOCK_FAILED:
+ case EXIT_PTYCMD_FAILED:
+ av_type = PW_PORT_ERROR;
+ break;
+
+ case EXIT_PEER_AUTH_FAILED:
+ case EXIT_AUTH_TOPEER_FAILED:
+ case EXIT_NEGOTIATION_FAILED:
+ case EXIT_CNID_AUTH_FAILED:
+ av_type = PW_SERVICE_UNAVAILABLE;
+ break;
+
+ case EXIT_IDLE_TIMEOUT:
+ av_type = PW_ACCT_IDLE_TIMEOUT;
+ break;
+
+ case EXIT_CONNECT_TIME:
+ av_type = PW_ACCT_SESSION_TIMEOUT;
+ break;
+
+#ifdef MAXOCTETS
+ case EXIT_TRAFFIC_LIMIT:
+ av_type = PW_NAS_REQUEST;
+ break;
+#endif
+
+ default:
+ av_type = PW_NAS_ERROR;
+ break;
+ }
+ rc_avpair_add(&send, PW_ACCT_TERMINATE_CAUSE, &av_type, 0, VENDOR_NONE);
+