@@ -438,7 +438,7 @@ MODEM_CMD_DEFINE(on_cmd_unsol_rdy)
438438 * Desc: This function will send "binary" data over the socket object.
439439 */
440440static ssize_t send_socket_data (struct modem_socket * sock ,
441- const struct sockaddr * dst_addr ,
441+ const struct net_sockaddr * dst_addr ,
442442 struct modem_cmd * handler_cmds ,
443443 size_t handler_cmds_len ,
444444 const char * buf , size_t buf_len ,
@@ -518,7 +518,7 @@ static ssize_t send_socket_data(struct modem_socket *sock,
518518 * Desc: This function will send data on the socket object.
519519 */
520520static ssize_t offload_sendto (void * obj , const void * buf , size_t len ,
521- int flags , const struct sockaddr * to ,
521+ int flags , const struct net_sockaddr * to ,
522522 socklen_t tolen )
523523{
524524 int ret ;
@@ -549,7 +549,7 @@ static ssize_t offload_sendto(void *obj, const void *buf, size_t len,
549549 }
550550
551551 /* UDP is not supported. */
552- if (sock -> ip_proto == IPPROTO_UDP ) {
552+ if (sock -> ip_proto == NET_IPPROTO_UDP ) {
553553 errno = ENOTSUP ;
554554 return -1 ;
555555 }
@@ -575,7 +575,7 @@ static ssize_t offload_sendto(void *obj, const void *buf, size_t len,
575575 * Desc: This function will receive data on the socket object.
576576 */
577577static ssize_t offload_recvfrom (void * obj , void * buf , size_t len ,
578- int flags , struct sockaddr * from ,
578+ int flags , struct net_sockaddr * from ,
579579 socklen_t * fromlen )
580580{
581581 struct modem_socket * sock = (struct modem_socket * )obj ;
@@ -684,7 +684,7 @@ static int offload_ioctl(void *obj, unsigned int request, va_list args)
684684/* Func: offload_connect
685685 * Desc: This function will connect with a provided TCP.
686686 */
687- static int offload_connect (void * obj , const struct sockaddr * addr ,
687+ static int offload_connect (void * obj , const struct net_sockaddr * addr ,
688688 socklen_t addrlen )
689689{
690690 struct modem_socket * sock = (struct modem_socket * ) obj ;
@@ -713,14 +713,14 @@ static int offload_connect(void *obj, const struct sockaddr *addr,
713713 }
714714
715715 /* Find the correct destination port. */
716- if (addr -> sa_family == AF_INET6 ) {
717- dst_port = ntohs (net_sin6 (addr )-> sin6_port );
718- } else if (addr -> sa_family == AF_INET ) {
719- dst_port = ntohs (net_sin (addr )-> sin_port );
716+ if (addr -> sa_family == NET_AF_INET6 ) {
717+ dst_port = net_ntohs (net_sin6 (addr )-> sin6_port );
718+ } else if (addr -> sa_family == NET_AF_INET ) {
719+ dst_port = net_ntohs (net_sin (addr )-> sin_port );
720720 }
721721
722722 /* UDP is not supported. */
723- if (sock -> ip_proto == IPPROTO_UDP ) {
723+ if (sock -> ip_proto == NET_IPPROTO_UDP ) {
724724 errno = ENOTSUP ;
725725 return -1 ;
726726 }
@@ -811,7 +811,7 @@ static int offload_close(void *obj)
811811/* Func: offload_sendmsg
812812 * Desc: This function sends messages to the modem.
813813 */
814- static ssize_t offload_sendmsg (void * obj , const struct msghdr * msg , int flags )
814+ static ssize_t offload_sendmsg (void * obj , const struct net_msghdr * msg , int flags )
815815{
816816 ssize_t sent = 0 ;
817817 int rc ;
@@ -1129,16 +1129,16 @@ static struct offloaded_if_api api_funcs = {
11291129
11301130static bool offload_is_supported (int family , int type , int proto )
11311131{
1132- if (family != AF_INET &&
1133- family != AF_INET6 ) {
1132+ if (family != NET_AF_INET &&
1133+ family != NET_AF_INET6 ) {
11341134 return false;
11351135 }
11361136
1137- if (type != SOCK_STREAM ) {
1137+ if (type != NET_SOCK_STREAM ) {
11381138 return false;
11391139 }
11401140
1141- if (proto != IPPROTO_TCP ) {
1141+ if (proto != NET_IPPROTO_TCP ) {
11421142 return false;
11431143 }
11441144
@@ -1287,4 +1287,4 @@ NET_DEVICE_DT_INST_OFFLOAD_DEFINE(0, modem_init, NULL,
12871287
12881288/* Register NET sockets. */
12891289NET_SOCKET_OFFLOAD_REGISTER (quectel_bg9x , CONFIG_NET_SOCKETS_OFFLOAD_PRIORITY ,
1290- AF_UNSPEC , offload_is_supported , offload_socket );
1290+ NET_AF_UNSPEC , offload_is_supported , offload_socket );
0 commit comments