Lines Matching refs:sq

16 static int qrtr_getname(int sock, struct sockaddr_qrtr *sq)  in qrtr_getname()  argument
18 socklen_t sl = sizeof(*sq); in qrtr_getname()
21 rc = getsockname(sock, (void *)sq, &sl); in qrtr_getname()
27 if (sq->sq_family != AF_QIPCRTR || sl != sizeof(*sq)) in qrtr_getname()
55 struct sockaddr_qrtr sq; in qrtr_open() local
57 sq.sq_family = AF_QIPCRTR; in qrtr_open()
58 sq.sq_node = 1; in qrtr_open()
59 sq.sq_port = rport; in qrtr_open()
61 rc = bind(sock, (void *)&sq, sizeof(sq)); in qrtr_open()
81 struct sockaddr_qrtr sq; in qrtr_sendto() local
84 sq.sq_family = AF_QIPCRTR; in qrtr_sendto()
85 sq.sq_node = node; in qrtr_sendto()
86 sq.sq_port = port; in qrtr_sendto()
88 rc = sendto(sock, data, sz, 0, (void *)&sq, sizeof(sq)); in qrtr_sendto()
100 struct sockaddr_qrtr sq; in qrtr_new_server() local
102 if (qrtr_getname(sock, &sq)) in qrtr_new_server()
111 return qrtr_sendto(sock, sq.sq_node, QRTR_PORT_CTRL, &pkt, sizeof(pkt)); in qrtr_new_server()
117 struct sockaddr_qrtr sq; in qrtr_remove_server() local
119 if (qrtr_getname(sock, &sq)) in qrtr_remove_server()
127 pkt.server.node = cpu_to_le32(sq.sq_node); in qrtr_remove_server()
128 pkt.server.port = cpu_to_le32(sq.sq_port); in qrtr_remove_server()
130 return qrtr_sendto(sock, sq.sq_node, QRTR_PORT_CTRL, &pkt, sizeof(pkt)); in qrtr_remove_server()
146 struct sockaddr_qrtr sq; in qrtr_new_lookup() local
148 if (qrtr_getname(sock, &sq)) in qrtr_new_lookup()
157 return qrtr_sendto(sock, sq.sq_node, QRTR_PORT_CTRL, &pkt, sizeof(pkt)); in qrtr_new_lookup()
163 struct sockaddr_qrtr sq; in qrtr_remove_lookup() local
165 if (qrtr_getname(sock, &sq)) in qrtr_remove_lookup()
173 pkt.server.node = cpu_to_le32(sq.sq_node); in qrtr_remove_lookup()
174 pkt.server.port = cpu_to_le32(sq.sq_port); in qrtr_remove_lookup()
176 return qrtr_sendto(sock, sq.sq_node, QRTR_PORT_CTRL, &pkt, sizeof(pkt)); in qrtr_remove_lookup()
202 struct sockaddr_qrtr sq; in qrtr_recvfrom() local
206 sl = sizeof(sq); in qrtr_recvfrom()
207 rc = recvfrom(sock, buf, bsz, 0, (void *)&sq, &sl); in qrtr_recvfrom()
213 *node = sq.sq_node; in qrtr_recvfrom()
215 *port = sq.sq_port; in qrtr_recvfrom()
220 const struct sockaddr_qrtr *sq) in qrtr_decode() argument
224 if (sq->sq_port == QRTR_PORT_CTRL){ in qrtr_decode()
250 dest->node = sq->sq_node; in qrtr_decode()
251 dest->port = sq->sq_port; in qrtr_decode()