void make_call_admin_shutdown(struct pptp_out_call_rply *rply_packet, ssize_t * rply_size) { struct pptp_call_disconn_ntfy call_disconn_ntfy; u_int16_t pac_call_id; /* Form a reply * The reply packet is a CALL-DISCONECT-NOTIFY * In single call mode we don't care what peer's call ID is, so don't even bother looking */ if ((pac_call_id = freecall()) == htons(-1)) { /* XXX should return an error */ syslog(LOG_ERR, "CTRL: Could not free Call ID [admin shutdown]!"); } MAKE_CTRL_HEADER(call_disconn_ntfy, CALL_DISCONN_NTFY); call_disconn_ntfy.call_id = pac_call_id; call_disconn_ntfy.result_code = ADMIN_SHUTDOWN; /* disconnected by admin shutdown */ call_disconn_ntfy.error_code = NO_ERROR; call_disconn_ntfy.cause_code = htons(NO_ERROR); call_disconn_ntfy.reserved1 = htons(RESERVED); memset(call_disconn_ntfy.call_stats, 0, 128); COPY_CTRL_PACKET(call_disconn_ntfy, rply_packet, rply_size); DEBUG_PACKET("CALL DISCONNECT RPLY"); }
/* * deal_call_clr * * This method 'deals' with a CALL-CLEAR-REQUEST. After stripping down the * connection request a suitable reply is formed and stored in * 'rply_packet' ready for sending. * * args: packet (IN) - the packet that we have to deal with (should be a * CALL-CLEAR-REQUEST packet) * rply_packet (OUT) - suitable reply to the 'packet' we got. * rply_size (OUT) - size of the reply packet * */ void deal_call_clr(unsigned char *packet, unsigned char *rply_packet, ssize_t *rply_size) { struct pptp_call_disconn_ntfy call_disconn_ntfy; u_int16_t pac_call_id; /* Form a reply * The reply packet is a CALL-DISCONECT-NOTIFY * In single call mode we don't care what peer's call ID is, so don't even bother looking */ if ((pac_call_id = freecall()) == htons(-1)) { /* XXX should return an error */ syslog(LOG_ERR, "CTRL: Could not free Call ID [call clear]!"); } MAKE_CTRL_HEADER(call_disconn_ntfy, CALL_DISCONN_NTFY); call_disconn_ntfy.call_id = pac_call_id; call_disconn_ntfy.result_code = CALL_CLEAR_REQUEST; /* disconnected by call_clr_rqst */ call_disconn_ntfy.error_code = NO_ERROR; call_disconn_ntfy.cause_code = htons(NO_ERROR); call_disconn_ntfy.reserved1 = htons(RESERVED); memset(call_disconn_ntfy.call_stats, 0, 128); COPY_CTRL_PACKET(call_disconn_ntfy, rply_packet, rply_size); DEBUG_PACKET("CALL DISCONNECT RPLY"); }