Lines Matching refs:psm
830 send_padr(poesm_t *psm, const poemsg_t *pado) in send_padr() argument
843 psm->poesm_sequence++; in send_padr()
846 (void) poe_two_longs(poep, POETT_UNIQ, psm->poesm_localid, in send_padr()
847 psm->poesm_sequence); in send_padr()
915 act_none(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_none() argument
922 act_fail(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_fail() argument
931 act_spadi(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_spadi() argument
933 if (send_padi(psm->poesm_localid) != 0) in act_spadi()
939 if (psm->poesm_state == PCSMS_DEAD) { in act_spadi()
940 psm->poesm_count = 3; in act_spadi()
941 psm->poesm_interval = pado_wait_time; in act_spadi()
943 if ((psm->poesm_interval <<= 1) > RESTART_LIMIT) in act_spadi()
944 psm->poesm_interval = RESTART_LIMIT; in act_spadi()
946 psm->poesm_timer = psm->poesm_interval; in act_spadi()
953 act_add(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_add() argument
957 if (psm->poesm_lastoff == NULL) in act_add()
958 psm->poesm_firstoff = pmsg; in act_add()
960 psm->poesm_lastoff->poemsg_next = pmsg; in act_add()
961 psm->poesm_lastoff = pmsg; in act_add()
968 act_spadr(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_spadr() argument
974 if ((msgp = psm->poesm_firstoff) == NULL) in act_spadr()
976 retv = send_padr(psm, msgp); in act_spadr()
982 psm->poesm_firstoff = msgp->poemsg_next; in act_spadr()
983 msgp->poemsg_next = psm->poesm_tried; in act_spadr()
984 psm->poesm_tried = msgp; in act_spadr()
986 if (psm->poesm_state != PCSMS_REQSENT) { in act_spadr()
987 psm->poesm_count = 3; in act_spadr()
988 psm->poesm_interval = pads_wait_time; in act_spadr()
990 if ((psm->poesm_interval <<= 1) > RESTART_LIMIT) in act_spadr()
991 psm->poesm_interval = RESTART_LIMIT; in act_spadr()
993 psm->poesm_timer = psm->poesm_interval; in act_spadr()
1000 act_spadrp(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_spadrp() argument
1004 retv = send_padr(psm, pmsg); in act_spadrp()
1013 pmsg->poemsg_next = psm->poesm_tried; in act_spadrp()
1014 psm->poesm_tried = pmsg; in act_spadrp()
1015 return (psm->poesm_state); in act_spadrp()
1017 pmsg->poemsg_next = psm->poesm_firstoff; in act_spadrp()
1018 psm->poesm_firstoff = pmsg; in act_spadrp()
1019 if (psm->poesm_lastoff == NULL) in act_spadrp()
1020 psm->poesm_lastoff = pmsg; in act_spadrp()
1021 psm->poesm_count = 3; in act_spadrp()
1022 psm->poesm_timer = psm->poesm_interval = pads_wait_time; in act_spadrp()
1029 act_spadrn(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_spadrn() argument
1034 if ((msgp = psm->poesm_firstoff) == NULL) in act_spadrn()
1037 psm->poesm_firstoff = msgp->poemsg_next; in act_spadrn()
1038 msgp->poemsg_next = psm->poesm_tried; in act_spadrn()
1039 psm->poesm_tried = msgp; in act_spadrn()
1040 if ((msgp = psm->poesm_firstoff) == NULL) in act_spadrn()
1042 retv = send_padr(psm, msgp); in act_spadrn()
1046 psm->poesm_count = 3; in act_spadrn()
1047 psm->poesm_timer = psm->poesm_interval = pads_wait_time; in act_spadrn()
1068 act_open(poesm_t *psm, poemsg_t *pmsg, int event, int nextst) in act_open() argument
1086 ptp.ptp_lsessid = psm->poesm_localid; in act_open()
1193 static int (* const action_table[PCSMA__MAX])(poesm_t *psm, poemsg_t *pmsg,
1204 handle_event(poesm_t *psm, int event, poemsg_t *pmsg) in handle_event() argument
1211 poe_state(psm->poesm_state), psm->poesm_state, in handle_event()
1212 poe_action(client_action[psm->poesm_state][event]), in handle_event()
1213 client_action[psm->poesm_state][event]); in handle_event()
1215 nextst = (*action_table[client_action[psm->poesm_state][event]])(psm, in handle_event()
1216 pmsg, event, client_next_state[psm->poesm_state][event]); in handle_event()
1220 poe_state(psm->poesm_state), psm->poesm_state, in handle_event()
1223 psm->poesm_state = nextst; in handle_event()
1400 poesm_t psm; in find_server() local
1412 (void) memset(&psm, '\0', sizeof (psm)); in find_server()
1420 psm.poesm_sequence = getpid() << 16; in find_server()
1421 psm.poesm_localid = localid; in find_server()
1424 handle_event(&psm, PCSME_OPEN, NULL); in find_server()
1431 retv = poll(pfd, 1, psm.poesm_timer > 0 ? psm.poesm_timer : in find_server()
1440 psm.poesm_timer = 0; in find_server()
1441 handle_event(&psm, --psm.poesm_count > 0 ? PCSME_TOP : in find_server()
1447 if (psm.poesm_timer > 0) { in find_server()
1459 psm.poesm_timer -= tv.tv_sec*1000 + tv.tv_usec/1000; in find_server()
1501 (psm.poesm_firstoff == NULL || in find_server()
1502 memcmp(&psm.poesm_firstoff->poemsg_sender, in find_server()
1508 ehost(&psm.poesm_firstoff->poemsg_sender)); in find_server()
1516 if (seqval != psm.poesm_sequence) { in find_server()
1527 psm.poesm_sequence); in find_server()
1537 handle_event(&psm, PCSME_RPADT, &pmsg); in find_server()
1547 handle_event(&psm, retv != 0 ? PCSME_RPADSN : in find_server()
1558 handle_event(&psm, retv, &pmsg); in find_server()