Lines Matching defs:sopt

1095 ip_ctloutput(int op, struct socket *so, struct sockopt *sopt)
1105 if (sopt->sopt_level != IPPROTO_IP) {
1106 if (sopt->sopt_level == SOL_SOCKET && sopt->sopt_name == SO_NOHEADER)
1113 switch (sopt->sopt_name) {
1118 error = ip_pcbopts(inp, sopt);
1131 error = sockopt_getint(sopt, &optval);
1135 switch (sopt->sopt_name) {
1192 error = sockopt_getint(sopt, &optval);
1198 error = sockopt_get(sopt, &pktinfo, sizeof(pktinfo));
1237 error = ip_setmoptions(&inp->inp_moptions, sopt);
1241 error = sockopt_getint(sopt, &optval);
1262 error = sockopt_getint(sopt, &optval);
1273 sopt->sopt_data, sopt->sopt_size,
1287 switch (sopt->sopt_name) {
1300 error = sockopt_setmbuf(sopt, m);
1315 switch (sopt->sopt_name) {
1362 error = sockopt_setint(sopt, optval);
1366 switch (sopt->sopt_size) {
1370 error = sockopt_setint(sopt, optval);
1376 error = sockopt_set(sopt, &pktinfo,
1387 error = sockopt_setint(sopt, optval);
1397 /* XXX this will return EINVAL as sopt is empty */
1398 error = ipsec_get_policy(inp, sopt->sopt_data,
1399 sopt->sopt_size, &m);
1401 error = sockopt_setmbuf(sopt, m);
1411 error = ip_getmoptions(inp->inp_moptions, sopt);
1419 error = sockopt_setint(sopt, optval);
1424 error = sockopt_setint(sopt, optval);
1573 ip_pcbopts(struct inpcb *inp, const struct sockopt *sopt)
1587 if ((cnt = sopt->sopt_size) == 0) {
1591 cp = sopt->sopt_data;
1721 ip_getoptval(const struct sockopt *sopt, u_int8_t *val, u_int maxval)
1727 if (sopt == NULL)
1730 switch (sopt->sopt_size) {
1732 error = sockopt_get(sopt, &cval, sizeof(u_char));
1737 error = sockopt_get(sopt, &tval, sizeof(u_int));
1755 ip_get_membership(const struct sockopt *sopt, struct ifnet **ifp,
1761 error = sockopt_get(sopt, &mreq, sizeof(mreq));
1824 ip_add_membership(struct ip_moptions *imo, const struct sockopt *sopt)
1834 if (sopt->sopt_size == sizeof(struct ip_mreq))
1835 error = ip_get_membership(sopt, &ifp, &psref, &ia, true);
1838 error = ip6_get_membership(sopt, &ifp, &psref, &ia, sizeof(ia));
1898 ip_drop_membership(struct ip_moptions *imo, const struct sockopt *sopt)
1908 if (sopt->sopt_size == sizeof(struct ip_mreq))
1909 error = ip_get_membership(sopt, &ifp, &psref, &ia, false);
1912 error = ip6_get_membership(sopt, &ifp, &psref, &ia, sizeof(ia));
1958 ip_setmoptions(struct ip_moptions **pimo, const struct sockopt *sopt)
1984 switch (sopt->sopt_name) {
1990 error = sockopt_get(sopt, &addr, sizeof(addr));
2028 error = ip_getoptval(sopt, &imo->imo_multicast_ttl, MAXTTL);
2036 error = ip_getoptval(sopt, &imo->imo_multicast_loop, 1);
2040 error = ip_add_membership(imo, sopt);
2044 error = ip_drop_membership(imo, sopt);
2070 ip_getmoptions(struct ip_moptions *imo, struct sockopt *sopt)
2078 switch (sopt->sopt_name) {
2097 error = sockopt_set(sopt, &addr, sizeof(addr));
2104 error = sockopt_set(sopt, &optval, sizeof(optval));
2111 error = sockopt_set(sopt, &optval, sizeof(optval));