|
@@ -115,6 +115,7 @@ int udp_senddata ( struct udp_connection *conn ) {
|
115
|
115
|
*
|
116
|
116
|
* @v conn UDP connection
|
117
|
117
|
* @v peer Destination address
|
|
118
|
+ * @v netdev Net device via which to send (or NULL)
|
118
|
119
|
* @v data Data to send
|
119
|
120
|
* @v len Length of data
|
120
|
121
|
* @ret rc Return status code
|
|
@@ -125,8 +126,9 @@ int udp_senddata ( struct udp_connection *conn ) {
|
125
|
126
|
* call udp_senddata() and wait for its senddata() method to be
|
126
|
127
|
* called.
|
127
|
128
|
*/
|
128
|
|
-int udp_sendto ( struct udp_connection *conn, struct sockaddr_tcpip *peer,
|
129
|
|
- const void *data, size_t len ) {
|
|
129
|
+int udp_sendto_via ( struct udp_connection *conn, struct sockaddr_tcpip *peer,
|
|
130
|
+ struct net_device *netdev, const void *data,
|
|
131
|
+ size_t len ) {
|
130
|
132
|
struct udp_header *udphdr;
|
131
|
133
|
struct pk_buff *pkb;
|
132
|
134
|
|
|
@@ -162,7 +164,27 @@ int udp_sendto ( struct udp_connection *conn, struct sockaddr_tcpip *peer,
|
162
|
164
|
ntohs ( udphdr->len ) );
|
163
|
165
|
|
164
|
166
|
/* Send it to the next layer for processing */
|
165
|
|
- return tcpip_tx ( pkb, &udp_protocol, peer, NULL, &udphdr->chksum );
|
|
167
|
+ return tcpip_tx ( pkb, &udp_protocol, peer, netdev, &udphdr->chksum );
|
|
168
|
+}
|
|
169
|
+
|
|
170
|
+/**
|
|
171
|
+ * Transmit data via a UDP connection to a specified address
|
|
172
|
+ *
|
|
173
|
+ * @v conn UDP connection
|
|
174
|
+ * @v peer Destination address
|
|
175
|
+ * @v data Data to send
|
|
176
|
+ * @v len Length of data
|
|
177
|
+ * @ret rc Return status code
|
|
178
|
+ *
|
|
179
|
+ * This function fills up the UDP headers and sends the data. It may
|
|
180
|
+ * be called only from within the context of an application's
|
|
181
|
+ * senddata() method; if the application wishes to send data it must
|
|
182
|
+ * call udp_senddata() and wait for its senddata() method to be
|
|
183
|
+ * called.
|
|
184
|
+ */
|
|
185
|
+int udp_sendto ( struct udp_connection *conn, struct sockaddr_tcpip *peer,
|
|
186
|
+ const void *data, size_t len ) {
|
|
187
|
+ return udp_sendto_via ( conn, peer, NULL, data, len );
|
166
|
188
|
}
|
167
|
189
|
|
168
|
190
|
/**
|