|
@@ -77,9 +77,13 @@ int xfer_open_uri ( struct xfer_interface *xfer, const char *uri_string ) {
|
77
|
77
|
* @v xfer Data transfer interface
|
78
|
78
|
* @v domain Communication domain (e.g. PF_INET)
|
79
|
79
|
* @v type Communication semantics (e.g. SOCK_STREAM)
|
|
80
|
+ * @v peer Peer socket address
|
|
81
|
+ * @v local Local socket address, or NULL
|
|
82
|
+ * @ret rc Return status code
|
80
|
83
|
*/
|
81
|
84
|
int xfer_open_socket ( struct xfer_interface *xfer,
|
82
|
|
- int domain, int type, struct sockaddr *sa ) {
|
|
85
|
+ int domain, int type, struct sockaddr *peer,
|
|
86
|
+ struct sockaddr *local ) {
|
83
|
87
|
struct socket_opener *opener;
|
84
|
88
|
|
85
|
89
|
DBGC ( xfer, "XFER %p opening (%s,%s) socket\n", xfer,
|
|
@@ -88,7 +92,7 @@ int xfer_open_socket ( struct xfer_interface *xfer,
|
88
|
92
|
for ( opener = socket_openers; opener < socket_openers_end; opener++ ){
|
89
|
93
|
if ( ( opener->domain == domain ) &&
|
90
|
94
|
( opener->type == type ) ) {
|
91
|
|
- return opener->open ( xfer, sa );
|
|
95
|
+ return opener->open ( xfer, peer, local );
|
92
|
96
|
}
|
93
|
97
|
}
|
94
|
98
|
|
|
@@ -115,9 +119,10 @@ int xfer_vopen ( struct xfer_interface *xfer, int type, va_list args ) {
|
115
|
119
|
case LOCATION_SOCKET: {
|
116
|
120
|
int domain = va_arg ( args, int );
|
117
|
121
|
int type = va_arg ( args, int );
|
118
|
|
- struct sockaddr *sa = va_arg ( args, struct sockaddr * );
|
|
122
|
+ struct sockaddr *peer = va_arg ( args, struct sockaddr * );
|
|
123
|
+ struct sockaddr *local = va_arg ( args, struct sockaddr * );
|
119
|
124
|
|
120
|
|
- return xfer_open_socket ( xfer, domain, type, sa ); }
|
|
125
|
+ return xfer_open_socket ( xfer, domain, type, peer, local ); }
|
121
|
126
|
default:
|
122
|
127
|
DBGC ( xfer, "XFER %p attempted to open unsupported location "
|
123
|
128
|
"type %d\n", xfer, type );
|