/* Determine whether a given request should be forwarded. */ int request_redundant(struct interface *ifp, const unsigned char *prefix, unsigned char plen, const unsigned char *src_prefix, unsigned char src_plen, unsigned short seqno, const unsigned char *id) { struct resend *request; request = find_request(prefix, plen, src_prefix, src_plen, NULL); if(request == NULL || resend_expired(request)) return 0; if(memcmp(request->id, id, 8) == 0 && seqno_compare(request->seqno, seqno) > 0) return 0; if(request->ifp != NULL && request->ifp != ifp) return 0; if(request->max > 0) /* Will be resent. */ return 1; if(timeval_minus_msec(&now, &request->time) < (ifp ? MIN(ifp->hello_interval, 1000) : 1000)) /* Fairly recent. */ return 1; return 0; }
int satisfy_request(const unsigned char *prefix, unsigned char plen, const unsigned char *src_prefix, unsigned char src_plen, unsigned short seqno, const unsigned char *id, struct interface *ifp) { struct resend *request, *previous; request = find_request(prefix, plen, src_prefix, src_plen, &previous); if(request == NULL) return 0; if(ifp != NULL && request->ifp != ifp) return 0; if(memcmp(request->id, id, 8) != 0 || seqno_compare(request->seqno, seqno) <= 0) { /* We cannot remove the request, as we may be walking the list right now. Mark it as expired, so that expire_resend will remove it. */ request->max = 0; request->time.tv_sec = 0; recompute_resend_time(); return 1; } return 0; }
/* * Process WM_CON records * If there isn't already a request node for this reqid.arrayid, * make one. */ static void wm_con(struct wkmgmtbs *wbuf) { struct wkmgmtbs *riptr = NULL; struct wmreq *rqptr; if (db_flag > 8) { Ndebug("wm_con(9): CON - reqid(%lld), arrayid(%d).\n", wbuf->reqid, wbuf->arrayid); } if ((rqptr = find_request(wbuf->reqid, wbuf->arrayid)) == NULL) { /* * This is a new request. No other records for this * request have been seen. */ if (db_flag > 2) { Ndebug("wm_con(3): Only WM_CON record " "found for reqid(%lld), subtype(%d).\n", wbuf->reqid, wbuf->subtype); } make_request(NORM_REQ); rqptr = rhead->last; rqptr->reqid = wbuf->reqid; rqptr->arrayid = wbuf->arrayid; rqptr->stime = wbuf->time; riptr = rqptr->slast->riptr; init_wkmgmtbs(riptr, wbuf); } return; }
void mpi_testall_ (int* count, int * requests, int *flag, MPI_Status * statuses, int* ierr){ MPI_Request* reqs; int i; reqs = xbt_new(MPI_Request, *count); for(i = 0; i < *count; i++) { reqs[i] = find_request(requests[i]); } *ierr= MPI_Testall(*count, reqs, flag, statuses); }
void mpi_waitall_(int* count, int* requests, MPI_Status* status, int* ierr) { MPI_Request* reqs; int i; reqs = xbt_new(MPI_Request, *count); for(i = 0; i < *count; i++) { reqs[i] = find_request(requests[i]); } *ierr = MPI_Waitall(*count, reqs, status); free(reqs); }
/* * Process WM_TERM records * Add the termination code to the reqinfo node. */ static void wm_term(struct wkmgmtbs *wbuf) { struct wkmgmtbs *riptr; struct wmreq *rqptr; if (db_flag > 8) { Ndebug("wm_term(9): TERM - reqid(%lld), arrayid(%d).\n", wbuf->reqid, wbuf->arrayid); } if ((rqptr = find_request(wbuf->reqid, wbuf->arrayid)) == NULL) { make_request(NORM_REQ); rqptr = rhead->last; rqptr->reqid = wbuf->reqid; rqptr->arrayid = wbuf->arrayid; riptr = rqptr->slast->riptr; init_wkmgmtbs(riptr, wbuf); } else if (rqptr->slast == NULL) { make_segment(rqptr, NORM_REQ); riptr = rqptr->slast->riptr; init_wkmgmtbs(riptr, wbuf); } else { riptr = rqptr->slast->riptr; } /* * The last node on the segment list should be * what we want. If not, the records in the file * are out of order. */ if (riptr->term_subtype == WM_NO_TERM) { riptr->code = wbuf->code; riptr->utime = wbuf->utime; riptr->stime = wbuf->stime; riptr->term_subtype = wbuf->subtype; } else { if (db_flag > 2) { Ndebug("wm_term(3): reqinfo node not " "at end of segment list.\n" "\triptr: term_subtype(%d), jid(0x%llx), " "wbuf->jid(0x%llx), rqptr->ltype(%d).\n", riptr->term_subtype, riptr->jid, wbuf->jid, rqptr->ltype); } return; /* ignore this record */ } rqptr->ltype = wbuf->type; rqptr->lsubtype = wbuf->subtype; return; }
static void update_request(HttpReqBase* http_req) { HttpReqBase* p = NULL; if (NULL == http_req) { return; } p = find_request(http_req->GetId()); if (NULL != p) { memcpy(p, http_req, http_req->GetSize()); } }
int unsatisfied_request(const unsigned char *prefix, unsigned char plen, unsigned short seqno, const unsigned char *id) { struct resend *request; request = find_request(prefix, plen, NULL); if(request == NULL || resend_expired(request)) return 0; if(memcmp(request->id, id, 8) != 0 || seqno_compare(request->seqno, seqno) <= 0) return 1; return 0; }
static void save_request(HttpReqBase* http_req) { HttpReqBase* p = NULL; if (NULL == http_req) { return; } p = find_request(http_req->GetId()); if (NULL == p) { vshttp_printf("save request:%s\n", http_req->GetId()); gHttpReq[g_write_index] = http_req; g_write_index = g_write_index + 1; } }
void do_announce (CTL_MSG * mp, CTL_RESPONSE * rp) { struct hostent *hp; CTL_MSG *ptr; int result; result = find_user (mp->r_name, mp->r_tty); if (result != SUCCESS) { rp->answer = result; return; } hp = gethostbyaddr ((char *) &os2sin_addr (mp->ctl_addr), sizeof (struct in_addr), AF_INET); if (!hp) { rp->answer = MACHINE_UNKNOWN; return; } ptr = find_request (mp); if (!ptr) { insert_table (mp, rp); rp->answer = announce (mp, hp->h_name); return; } if (mp->id_num > ptr->id_num) { /* Explicit re-announce: update the id_num to avoid duplicates and re-announce the talk. */ ptr->id_num = new_id (); rp->id_num = htonl (ptr->id_num); rp->answer = announce (mp, hp->h_name); } else { /* a duplicated request, so ignore it */ rp->id_num = htonl (ptr->id_num); rp->answer = SUCCESS; } }
int vshttpclient_send_request_next(char* req_id) { HttpReqBase* p = NULL; if (NULL == req_id) { return -1; } p = find_request(req_id); if (NULL != p) { p->SendRequestNext(); } else { vshttp_printf("request is not exist\n"); } return 0; }
void do_announce(CTL_MSG *mp, CTL_RESPONSE *rp) { struct hostent *hp; CTL_MSG *ptr; int result; /* see if the user is logged */ result = find_user(mp->r_name, mp->r_tty); if (result != SUCCESS) { rp->answer = result; return; } #define satosin(sa) ((struct sockaddr_in *)(void *)(sa)) hp = gethostbyaddr(&satosin(&mp->ctl_addr)->sin_addr, sizeof (struct in_addr), AF_INET); if (hp == NULL) { rp->answer = MACHINE_UNKNOWN; return; } ptr = find_request(mp); if (ptr == NULL) { insert_table(mp, rp); rp->answer = announce(mp, hp->h_name); return; } if (mp->id_num > ptr->id_num) { /* * This is an explicit re-announce, so update the id_num * field to avoid duplicates and re-announce the talk. */ ptr->id_num = new_id(); rp->id_num = htonl(ptr->id_num); rp->answer = announce(mp, hp->h_name); } else { /* a duplicated request, so ignore it */ rp->id_num = htonl(ptr->id_num); rp->answer = SUCCESS; } }
/* * Process WM_RECV records * If a request node does not exist for the request ID, * add one to the end of the request linked list. Update * necessary fields. * * If there are multiple WM_RECV records (request moves from pipe * to batch queue), the start queue wait time (sqtime) is set to the * time of the first record (usually pipe queue). Also update the * queue type and name so we always have the most current type and * name. * * The initial time stamp for this segment is set to the time of * the most recent WM_RECV record. * * NOTE: WM_RECV records do not contain valid jids. */ static void wm_recv(struct wkmgmtbs *wbuf) { struct wkmgmtbs *riptr; struct wmreq *rqptr; if (db_flag > 8) { Ndebug("wm_recv(9): RECV - reqid(%lld), arrayid(%d).\n", wbuf->reqid, wbuf->arrayid); } if ((rqptr = find_request(wbuf->reqid, wbuf->arrayid)) == NULL) { make_request(NORM_REQ); rqptr = rhead->last; rqptr->reqid = wbuf->reqid; rqptr->arrayid = wbuf->arrayid; rqptr->stime = wbuf->time; riptr = rqptr->slast->riptr; init_wkmgmtbs(riptr, wbuf); riptr->jid = WM_NO_JID; } else if (rqptr->slast == NULL) { rqptr->stime = wbuf->time; /* update */ make_segment(rqptr, NORM_REQ); riptr = rqptr->slast->riptr; init_wkmgmtbs(riptr, wbuf); riptr->jid = WM_NO_JID; } else { riptr = rqptr->slast->riptr; } riptr->qtype = wbuf->qtype; strcpy(riptr->quename, wbuf->quename); rqptr->ltype = wbuf->type; rqptr->lsubtype = wbuf->subtype; return; }
void process_request(CTL_MSG *mp, CTL_RESPONSE *rp) { CTL_MSG *ptr; char *s; rp->vers = TALK_VERSION; rp->type = mp->type; rp->id_num = htonl(0); if (mp->vers != TALK_VERSION) { syslog(LOG_WARNING, "bad protocol version %d", mp->vers); rp->answer = BADVERSION; return; } mp->id_num = ntohl(mp->id_num); mp->addr.sa_family = ntohs(mp->addr.sa_family); if (mp->addr.sa_family != AF_INET) { syslog(LOG_WARNING, "bad address, family %d", mp->addr.sa_family); rp->answer = BADADDR; return; } mp->ctl_addr.sa_family = ntohs(mp->ctl_addr.sa_family); if (mp->ctl_addr.sa_family != AF_INET) { syslog(LOG_WARNING, "bad control address, family %d", mp->ctl_addr.sa_family); rp->answer = BADCTLADDR; return; } for (s = mp->l_name; *s; s++) if (!isprint(*s)) { syslog(LOG_NOTICE, "illegal user name. Aborting"); rp->answer = FAILED; return; } mp->pid = ntohl(mp->pid); if (debug) print_request("process_request", mp); switch (mp->type) { case ANNOUNCE: do_announce(mp, rp); break; case LEAVE_INVITE: ptr = find_request(mp); if (ptr != NULL) { rp->id_num = htonl(ptr->id_num); rp->answer = SUCCESS; } else insert_table(mp, rp); break; case LOOK_UP: ptr = find_match(mp); if (ptr != NULL) { rp->id_num = htonl(ptr->id_num); rp->addr = ptr->addr; rp->addr.sa_family = htons(ptr->addr.sa_family); rp->answer = SUCCESS; } else rp->answer = NOT_HERE; break; case DELETE: rp->answer = delete_invite(mp->id_num); break; default: rp->answer = UNKNOWN_REQUEST; break; } if (debug) print_response("process_request", rp); }
void mpi_test_ (int * request, int *flag, MPI_Status * status, int* ierr){ MPI_Request req = find_request(*request); *ierr= MPI_Test(&req, flag, status); }
/******************************************************************** * FUNCTION mgr_rpc_dispatch * * Dispatch an incoming <rpc-reply> response * handle the <rpc-reply> element * called by mgr_top.c: * This function is registered with top_register_node * for the module 'netconf', top-node 'rpc-reply' * * INPUTS: * scb == session control block * top == top element descriptor *********************************************************************/ void mgr_rpc_dispatch (ses_cb_t *scb, xml_node_t *top) { obj_template_t *rpyobj; mgr_rpc_rpy_t *rpy; mgr_rpc_req_t *req; xml_attr_t *attr; xmlChar *msg_id; ncx_module_t *mod; mgr_rpc_cbfn_t handler; ncx_num_t num; status_t res; #ifdef DEBUG if (!scb || !top) { SET_ERROR(ERR_INTERNAL_PTR); return; } #endif /* init local vars */ res = NO_ERR; msg_id = NULL; req = NULL; /* make sure any real session has been properly established */ if (scb->type != SES_TYP_DUMMY && scb->state != SES_ST_IDLE) { log_error("\nError: mgr_rpc: skipping incoming message '%s'", top->qname); mgr_xml_skip_subtree(scb->reader, top); return; } /* check if the reply template is already cached */ rpyobj = NULL; mod = ncx_find_module(NC_MODULE, NULL); if (mod != NULL) { rpyobj = ncx_find_object(mod, NC_RPC_REPLY_TYPE); } if (rpyobj == NULL) { SET_ERROR(ERR_NCX_DEF_NOT_FOUND); mgr_xml_skip_subtree(scb->reader, top); return; } /* get the NC RPC message-id attribute; should be present * because the send-rpc function put a message-id in <rpc> */ attr = xml_find_attr(top, 0, NCX_EL_MESSAGE_ID); if (attr && attr->attr_val) { msg_id = xml_strdup(attr->attr_val); } if (msg_id == NULL) { mgr_xml_skip_subtree(scb->reader, top); log_info("\nmgr_rpc: incoming message with no message-id"); return; } /* the current node is 'rpc-reply' in the netconf namespace * First get a new RPC reply struct */ rpy = new_reply(); if (rpy == NULL) { m__free(msg_id); log_error("\nError: mgr_rpc: skipping incoming message"); mgr_xml_skip_subtree(scb->reader, top); return; } else { rpy->msg_id = msg_id; } /* get the NCX RPC group-id attribute if present */ attr = xml_find_attr(top, xmlns_ncx_id(), NCX_EL_GROUP_ID); if (attr && attr->attr_val) { res = ncx_decode_num(attr->attr_val, NCX_BT_UINT32, &num); if (res == NO_ERR) { rpy->group_id = num.u; } } /* find the request that goes with this reply */ if (rpy->msg_id != NULL) { req = find_request(scb, rpy->msg_id); if (req == NULL) { #ifdef MGR_RPC_DEBUG log_debug("\nmgr_rpc: got request found for msg (%s) " "on session %d", rpy->msg_id, scb->sid); #endif mgr_xml_skip_subtree(scb->reader, top); mgr_rpc_free_reply(rpy); return; } else { dlq_remove(req); } } /* have a request/reply pair, so parse the reply * as a val_value_t tree, stored in rpy->reply */ rpy->res = mgr_val_parse_reply(scb, rpyobj, (req != NULL) ? req->rpc : ncx_get_gen_anyxml(), top, rpy->reply); if (rpy->res != NO_ERR && LOGINFO) { log_info("\nmgr_rpc: got invalid reply on session %d (%s)", scb->sid, get_error_string(rpy->res)); } /* check that there is nothing after the <rpc-reply> element */ if (rpy->res==NO_ERR && !xml_docdone(scb->reader) && LOGINFO) { log_info("\nmgr_rpc: got extra nodes in reply on session %d", scb->sid); } /* invoke the reply handler */ if (req != NULL) { handler = (mgr_rpc_cbfn_t)req->replycb; (*handler)(scb, req, rpy); } /* only reset the session state to idle if was not changed * to SES_ST_SHUTDOWN_REQ during this RPC call */ if (scb->state == SES_ST_IN_MSG) { scb->state = SES_ST_IDLE; } #ifdef MGR_RPC_DEBUG print_errors(); clear_errors(); #endif } /* mgr_rpc_dispatch */
void mpi_wait_(int* request, MPI_Status* status, int* ierr) { MPI_Request req = find_request(*request); *ierr = MPI_Wait(&req, status); }
void mpi_start_(int* request, int* ierr) { MPI_Request req = find_request(*request); *ierr = MPI_Start(&req); }
void process_request(CTL_MSG *mp, CTL_RESPONSE *rp) { CTL_MSG *ptr; char *s; rp->vers = TALK_VERSION; rp->type = mp->type; rp->id_num = htonl(0); if (mp->vers != TALK_VERSION) { syslog(LOG_WARNING, "Bad protocol version %d", mp->vers); rp->answer = BADVERSION; return; } mp->id_num = ntohl(mp->id_num); if (ntohs(mp->addr.sa_family) != AF_INET) { syslog(LOG_WARNING, "Bad address, family %d", ntohs(mp->addr.sa_family)); rp->answer = BADADDR; return; } if (ntohs(mp->ctl_addr.sa_family) != AF_INET) { syslog(LOG_WARNING, "Bad control address, family %d", ntohs(mp->ctl_addr.sa_family)); rp->answer = BADCTLADDR; return; } for (s = mp->l_name; *s; s++) if (!isprint((unsigned char)*s)) { syslog(LOG_NOTICE, "Illegal user name. Aborting"); rp->answer = FAILED; return; } if (memcmp(&satosin(&rp->addr)->sin_addr, &satosin(&mp->ctl_addr)->sin_addr, sizeof(struct in_addr))) { char buf1[32], buf2[32]; strlcpy(buf1, inet_ntoa(satosin(&rp->addr)->sin_addr), sizeof(buf1)); strlcpy(buf2, inet_ntoa(satosin(&mp->ctl_addr)->sin_addr), sizeof(buf2)); syslog(LOG_WARNING, "addresses are different, %s != %s", buf1, buf2); } rp->addr.sa_family = 0; mp->pid = ntohl(mp->pid); if (debug) print_request("process_request", mp); switch (mp->type) { case ANNOUNCE: do_announce(mp, rp); break; case LEAVE_INVITE: ptr = find_request(mp); if (ptr != (CTL_MSG *)0) { rp->id_num = htonl(ptr->id_num); rp->answer = SUCCESS; } else insert_table(mp, rp); break; case LOOK_UP: ptr = find_match(mp); if (ptr != (CTL_MSG *)0) { rp->id_num = htonl(ptr->id_num); rp->addr = ptr->addr; rp->addr.sa_family = ptr->addr.sa_family; rp->answer = SUCCESS; } else rp->answer = NOT_HERE; break; case DELETE: rp->answer = delete_invite(mp->id_num); break; default: rp->answer = UNKNOWN_REQUEST; break; } if (debug) print_response("process_request", rp); }
/* * Process WM_INIT records */ static void wm_init(struct wkmgmtbs *wbuf) { struct wkmgmtbs *riptr; struct wmreq *rqptr; struct wmseg *sptr; if (db_flag > 8) { Ndebug("wm_init(9): INIT - reqid(%lld), arrayid(%d).\n", wbuf->reqid, wbuf->arrayid); } /* * Ideally, this reqid should already have a request node, * but if it doesn't, we'll make one */ if ((rqptr = find_request(wbuf->reqid, wbuf->arrayid)) == NULL) { if (db_flag > 2) { Ndebug("wm_init(3): Making request node for " "reqid(%lld), type WM_INIT, subtype(%d).\n", wbuf->reqid, wbuf->subtype); } make_request(NORM_REQ); rqptr = rhead->last; rqptr->reqid = wbuf->reqid; rqptr->arrayid = wbuf->arrayid; } else if (rqptr->slast == NULL) { make_segment(rqptr, NORM_REQ); } /* * If the previous record type for this reqid is not * WM_RECV, we need to add a segment node to the end * of this reqid's list. */ if (rqptr->ltype != WM_RECV && rqptr->ltype != WM_NO_LTYPE) { sptr = make_segment(rqptr, NORM_REQ); riptr = sptr->riptr; } else { riptr = rqptr->slast->riptr; } /* * Initialize the wkmgmtbs(c) node with values from the * input record. */ init_wkmgmtbs(riptr, wbuf); riptr->init_subtype = wbuf->subtype; if (wbuf->enter_time > 0) { riptr->qwtime = wbuf->time - wbuf->enter_time; } rqptr->ltype = wbuf->type; rqptr->lsubtype = wbuf->subtype; /* * Time stamp on output record is always the time stamp * of the WM_INIT record, if it exists. */ rqptr->stime = riptr->start_time = wbuf->time; return; }
int process_request (CTL_MSG * msg, struct sockaddr_in *sa_in, CTL_RESPONSE * rp) { CTL_MSG *ptr; if (debug) { print_request ("process_request", msg); } if (acl_match (msg, sa_in)) { syslog (LOG_NOTICE, "dropping request: %s@%s", msg->l_name, inet_ntoa (sa_in->sin_addr)); return 1; } rp->vers = TALK_VERSION; rp->type = msg->type; rp->id_num = htonl (0); if (msg->vers != TALK_VERSION) { syslog (LOG_ERR, "Bad protocol version %d", msg->vers); rp->answer = BADVERSION; return 0; } msg->id_num = ntohl (msg->id_num); msg->addr.sa_family = ntohs (msg->addr.sa_family); if (msg->addr.sa_family != AF_INET) { syslog (LOG_ERR, "Bad address, family %d", msg->addr.sa_family); rp->answer = BADADDR; return 0; } msg->ctl_addr.sa_family = ntohs (msg->ctl_addr.sa_family); if (msg->ctl_addr.sa_family != AF_INET) { syslog (LOG_WARNING, "Bad control address, family %d", msg->ctl_addr.sa_family); rp->answer = BADCTLADDR; return 0; } /* FIXME: compare address and sa_in? */ msg->pid = ntohl (msg->pid); switch (msg->type) { case ANNOUNCE: do_announce (msg, rp); break; case LEAVE_INVITE: ptr = find_request (msg); if (ptr) { rp->id_num = htonl (ptr->id_num); rp->answer = SUCCESS; } else insert_table (msg, rp); break; case LOOK_UP: ptr = find_match (msg); if (ptr) { rp->id_num = htonl (ptr->id_num); rp->addr = ptr->addr; rp->addr.sa_family = htons (ptr->addr.sa_family); rp->answer = SUCCESS; } else rp->answer = NOT_HERE; break; case DELETE: rp->answer = delete_invite (msg->id_num); break; default: rp->answer = UNKNOWN_REQUEST; break; } if (debug) print_response ("process_request response", rp); return 0; }
/* * Process WM_SPOOL records * Update or create a wkmgmtbs(c) entry on the pp list. These * entries contain information about the pipeclients and * netclients. * */ static void wm_spool(struct wkmgmtbs *wbuf) { struct wkmgmtbs *riptr; struct wmreq *rqptr; struct wmseg *sptr; if (db_flag > 8) { Ndebug("wm_spool(9): SPOOL - reqid(%lld), arrayid(%d).\n", wbuf->reqid, wbuf->arrayid); } if ((rqptr = find_request(wbuf->reqid, wbuf->arrayid)) == NULL) { /* * This is a new reqid. Create request, segment * and wkmgmtbs(c) entries for it. */ if (db_flag > 2) { Ndebug("wm_spool(3): making request node for " "reqid(%lld), type WM_SPOOL, subtype(%d).\n", wbuf->reqid, wbuf->subtype); } make_request(AUX_REQ); rqptr = rhead->last; rqptr->reqid = wbuf->reqid; rqptr->arrayid = wbuf->arrayid; riptr = rqptr->pplast->riptr; init_wkmgmtbs(riptr, wbuf); } else if (rqptr->pplast == NULL) { /* * This reqid does not have any wkmgmtbs(c) entries on the * pp list, so make one. */ if (db_flag > 2) { Ndebug("wm_spool(3): pplast == NULL.\n"); } make_segment(rqptr, AUX_REQ); riptr = rqptr->pplast->riptr; init_wkmgmtbs(riptr, wbuf); } else { /* * Look through the entire pp list for this jid, since * there could be multiple active pipeclients and * netclients. If jid = 0 (which could happen on a * WM_SPOOL_TERM record), then update the first active * entry. */ int found = 0; if (db_flag > 2) { Ndebug("wm_spool(3): looking for a wkmgmtbs(c) " "entry with jid(0x%llx).\n", wbuf->jid); } for (sptr = rqptr->ppfirst, riptr = sptr->riptr; ((sptr != NULL) && (found == 0)); sptr = sptr->nptr) { riptr = sptr->riptr; switch (wbuf->jid) { case 0: if (riptr->term_subtype == WM_NO_TERM) { found = 1; } break; default: if (riptr->jid == wbuf->jid) { found = 1; } break; } /* end of switch(jid) */ } if (!found) { if (db_flag > 2) { Ndebug("wm_spool(3): making new " "segment node.\n"); } make_segment(rqptr, AUX_REQ); riptr = rqptr->pplast->riptr; init_wkmgmtbs(riptr, wbuf); } } /* * Update the wkmgmtbs(c) entry. */ switch (wbuf->subtype) { case WM_SPOOL_INIT: riptr->init_subtype = WM_SPOOL_INIT; break; case WM_SPOOL_TERM: if (riptr->init_subtype != WM_SPOOL_INIT) { riptr->init_subtype = WM_SPOOL_INIT; } riptr->utime = wbuf->utime; riptr->stime = wbuf->stime; riptr->term_subtype = WM_SPOOL_TERM; break; default: acct_err(ACCT_CAUT, _("An unknown NQ_SENT subtype (%d) was found in the '%s' routine."), wbuf->subtype, "wm_spool()"); break; } /* end of switch(subtype) */ return; }