Rev 4750 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4750 | Rev 4756 | ||
---|---|---|---|
Line 95... | Line 95... | ||
95 | 95 | ||
96 | /** Processes the received UDP packet queue. |
96 | /** Processes the received UDP packet queue. |
97 | * Is used as an entry point from the underlying IP module. |
97 | * Is used as an entry point from the underlying IP module. |
98 | * Locks the global lock and calls udp_process_packet() function. |
98 | * Locks the global lock and calls udp_process_packet() function. |
99 | * @param device_id The device identifier. Ignored parameter. |
99 | * @param device_id The device identifier. Ignored parameter. |
100 | * @param packet The received packet queue. Input/output parameter. |
100 | * @param[in,out] packet The received packet queue. |
101 | * @param receiver The target service. Ignored parameter. |
101 | * @param receiver The target service. Ignored parameter. |
102 | * @param error The packet error reporting service. Prefixes the received packet. Input parameter. |
102 | * @param[in] error The packet error reporting service. Prefixes the received packet. |
103 | * @returns EOK on success. |
103 | * @returns EOK on success. |
104 | * @returns Other error codes as defined for the udp_process_packet() function. |
104 | * @returns Other error codes as defined for the udp_process_packet() function. |
105 | */ |
105 | */ |
106 | int udp_received_msg( device_id_t device_id, packet_t packet, services_t receiver, services_t error ); |
106 | int udp_received_msg( device_id_t device_id, packet_t packet, services_t receiver, services_t error ); |
107 | 107 | ||
108 | /** Processes the received UDP packet queue. |
108 | /** Processes the received UDP packet queue. |
109 | * Notifies the destination socket application. |
109 | * Notifies the destination socket application. |
110 | * Releases the packet on error or sends an ICMP error notification.. |
110 | * Releases the packet on error or sends an ICMP error notification.. |
111 | * @param packet The received packet queue. Input/output parameter. |
111 | * @param[in,out] packet The received packet queue. |
112 | * @param error The packet error reporting service. Prefixes the received packet. Input parameter. |
112 | * @param[in] error The packet error reporting service. Prefixes the received packet. |
113 | * @returns EOK on success. |
113 | * @returns EOK on success. |
114 | * @returns EINVAL if the packet is not valid. |
114 | * @returns EINVAL if the packet is not valid. |
115 | * @returns EINVAL if the stored packet address is not the an_addr_t. |
115 | * @returns EINVAL if the stored packet address is not the an_addr_t. |
116 | * @returns EINVAL if the packet does not contain any data. |
116 | * @returns EINVAL if the packet does not contain any data. |
117 | * @returns NO_DATA if the packet content is shorter than the user datagram header. |
117 | * @returns NO_DATA if the packet content is shorter than the user datagram header. |
Line 120... | Line 120... | ||
120 | * @returns Other error codes as defined for the ip_client_process_packet() function. |
120 | * @returns Other error codes as defined for the ip_client_process_packet() function. |
121 | */ |
121 | */ |
122 | int udp_process_packet( packet_t packet, services_t error ); |
122 | int udp_process_packet( packet_t packet, services_t error ); |
123 | 123 | ||
124 | /** Releases the packet and returns the result. |
124 | /** Releases the packet and returns the result. |
125 | * @param packet The packet queue to be released. Input parameter. |
125 | * @param[in] packet The packet queue to be released. |
126 | * @param result The result to be returned. Input parameter. |
126 | * @param[in] result The result to be returned. |
127 | * @return The result parameter. |
127 | * @return The result parameter. |
128 | */ |
128 | */ |
129 | int udp_release_and_return( packet_t packet, int result ); |
129 | int udp_release_and_return( packet_t packet, int result ); |
130 | 130 | ||
131 | /** @name Socket messages processing functions |
131 | /** @name Socket messages processing functions |
132 | */ |
132 | */ |
133 | /*@{*/ |
133 | /*@{*/ |
134 | 134 | ||
135 | /** Processes the socket client messages. |
135 | /** Processes the socket client messages. |
136 | * Runs until the client module disconnects. |
136 | * Runs until the client module disconnects. |
137 | * @param callid The message identifier. Input parameter. |
137 | * @param[in] callid The message identifier. |
138 | * @param call The message parameters. Input parameter. |
138 | * @param[in] call The message parameters. |
139 | * @returns EOK on success. |
139 | * @returns EOK on success. |
140 | * @see socket.h |
140 | * @see socket.h |
141 | */ |
141 | */ |
142 | int udp_process_client_messages( ipc_callid_t callid, ipc_call_t call ); |
142 | int udp_process_client_messages( ipc_callid_t callid, ipc_call_t call ); |
143 | 143 | ||
144 | /** Sends data from the socket to the remote address. |
144 | /** Sends data from the socket to the remote address. |
145 | * Binds the socket to a free port if not already connected/bound. |
145 | * Binds the socket to a free port if not already connected/bound. |
146 | * Handles the NET_SOCKET_SENDTO message. |
146 | * Handles the NET_SOCKET_SENDTO message. |
147 | * Supports AF_INET and AF_INET6 address families. |
147 | * Supports AF_INET and AF_INET6 address families. |
148 | * @param local_sockets The application local sockets. Input/output parameter. |
148 | * @param[in,out] local_sockets The application local sockets. |
149 | * @param socket_id Socket identifier. Input parameter. |
149 | * @param[in] socket_id Socket identifier. |
150 | * @param addr The destination address. Input parameter. |
150 | * @param[in] addr The destination address. |
151 | * @param addrlen The address length. Input parameter. |
151 | * @param[in] addrlen The address length. |
152 | * @param fragments The number of data fragments. Input parameter. |
152 | * @param[in] fragments The number of data fragments. |
153 | * @param data_fragment_size The data fragment size in bytes. Input parameter. |
153 | * @param[in] data_fragment_size The data fragment size in bytes. |
154 | * @param flags Various send flags. Input parameter. |
154 | * @param[in] flags Various send flags. |
155 | * @returns EOK on success. |
155 | * @returns EOK on success. |
156 | * @returns EAFNOTSUPPORT if the address family is not supported. |
156 | * @returns EAFNOTSUPPORT if the address family is not supported. |
157 | * @returns ENOTSOCK if the socket is not found. |
157 | * @returns ENOTSOCK if the socket is not found. |
158 | * @returns EINVAL if the address is invalid. |
158 | * @returns EINVAL if the address is invalid. |
159 | * @returns ENOTCONN if the sending socket is not and cannot be bound. |
159 | * @returns ENOTCONN if the sending socket is not and cannot be bound. |
Line 165... | Line 165... | ||
165 | int udp_sendto_message( socket_cores_ref local_sockets, int socket_id, const struct sockaddr * addr, socklen_t addrlen, int fragments, size_t data_fragment_size, int flags ); |
165 | int udp_sendto_message( socket_cores_ref local_sockets, int socket_id, const struct sockaddr * addr, socklen_t addrlen, int fragments, size_t data_fragment_size, int flags ); |
166 | 166 | ||
167 | /** Receives data to the socket. |
167 | /** Receives data to the socket. |
168 | * Handles the NET_SOCKET_RECVFROM message. |
168 | * Handles the NET_SOCKET_RECVFROM message. |
169 | * Replies the source address as well. |
169 | * Replies the source address as well. |
170 | * @param local_sockets The application local sockets. Input parameter. |
170 | * @param[in] local_sockets The application local sockets. |
171 | * @param socket_id Socket identifier. Input parameter. |
171 | * @param[in] socket_id Socket identifier. |
172 | * @param flags Various receive flags. Input parameter. |
172 | * @param[in] flags Various receive flags. |
173 | * @param addrlen The source address length. Output parameter. |
173 | * @param[out] addrlen The source address length. |
174 | * @returns The number of bytes received. |
174 | * @returns The number of bytes received. |
175 | * @returns ENOTSOCK if the socket is not found. |
175 | * @returns ENOTSOCK if the socket is not found. |
176 | * @returns NO_DATA if there are no received packets or data. |
176 | * @returns NO_DATA if there are no received packets or data. |
177 | * @returns ENOMEM if there is not enough memory left. |
177 | * @returns ENOMEM if there is not enough memory left. |
178 | * @returns EINVAL if the received address is not an IP address. |
178 | * @returns EINVAL if the received address is not an IP address. |