Lines Matching refs:ss
45 static int32_t sdp_receive_error_pdu(sdp_session_p ss);
51 sdp_session_p ss = (sdp_session_p) xss; in sdp_register_service() local
56 if (ss == NULL) in sdp_register_service()
59 datalen == 0 || !(ss->flags & SDP_SESSION_LOCAL)) { in sdp_register_service()
60 ss->error = EINVAL; in sdp_register_service()
64 ss->error = EMSGSIZE; in sdp_register_service()
69 pdu.tid = htons(++ss->tid); in sdp_register_service()
87 len = writev(ss->s, iov, sizeof(iov)/sizeof(iov[0])); in sdp_register_service()
91 ss->error = errno; in sdp_register_service()
95 len = sdp_receive_error_pdu(ss); in sdp_register_service()
99 ss->error = EIO; in sdp_register_service()
104 *handle = (uint32_t) ss->rsp[--len]; in sdp_register_service()
105 *handle |= (uint32_t) ss->rsp[--len] << 8; in sdp_register_service()
106 *handle |= (uint32_t) ss->rsp[--len] << 16; in sdp_register_service()
107 *handle |= (uint32_t) ss->rsp[--len] << 24; in sdp_register_service()
116 sdp_session_p ss = (sdp_session_p) xss; in sdp_unregister_service() local
121 if (ss == NULL) in sdp_unregister_service()
123 if (!(ss->flags & SDP_SESSION_LOCAL)) { in sdp_unregister_service()
124 ss->error = EINVAL; in sdp_unregister_service()
128 ss->error = EMSGSIZE; in sdp_unregister_service()
133 pdu.tid = htons(++ss->tid); in sdp_unregister_service()
145 len = writev(ss->s, iov, sizeof(iov)/sizeof(iov[0])); in sdp_unregister_service()
149 ss->error = errno; in sdp_unregister_service()
153 return ((sdp_receive_error_pdu(ss) < 0)? -1 : 0); in sdp_unregister_service()
160 sdp_session_p ss = (sdp_session_p) xss; in sdp_change_service() local
165 if (ss == NULL) in sdp_change_service()
167 if (data == NULL || datalen == 0 || !(ss->flags & SDP_SESSION_LOCAL)) { in sdp_change_service()
168 ss->error = EINVAL; in sdp_change_service()
172 ss->error = EMSGSIZE; in sdp_change_service()
177 pdu.tid = htons(++ss->tid); in sdp_change_service()
192 len = writev(ss->s, iov, sizeof(iov)/sizeof(iov[0])); in sdp_change_service()
196 ss->error = errno; in sdp_change_service()
200 return ((sdp_receive_error_pdu(ss) < 0)? -1 : 0); in sdp_change_service()
204 sdp_receive_error_pdu(sdp_session_p ss) in sdp_receive_error_pdu() argument
211 len = read(ss->s, ss->rsp, ss->rsp_e - ss->rsp); in sdp_receive_error_pdu()
215 ss->error = errno; in sdp_receive_error_pdu()
219 pdu = (sdp_pdu_p) ss->rsp; in sdp_receive_error_pdu()
223 if (pdu->pid != SDP_PDU_ERROR_RESPONSE || pdu->tid != ss->tid || in sdp_receive_error_pdu()
225 ss->error = EIO; in sdp_receive_error_pdu()
229 error = (uint16_t) ss->rsp[sizeof(pdu)] << 8; in sdp_receive_error_pdu()
230 error |= (uint16_t) ss->rsp[sizeof(pdu) + 1]; in sdp_receive_error_pdu()
233 ss->error = EIO; in sdp_receive_error_pdu()