* Added optional {send,read}_data_no_buffer() hooks to the protocol

module interface. They directly operate on iovecs and thus allow
  protocols that don't need it to avoid the creation of a net_buffer.
* Adjusted the socket module to support the new hooks. If they are
  present, they will be chosen over the old hooks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25299 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-05-03 01:11:21 +00:00
parent 3134e71811
commit cdc00dadfc
3 changed files with 106 additions and 44 deletions
+9
View File
@@ -19,6 +19,8 @@
struct ancillary_data_container;
struct ancillary_data_header;
struct iovec;
typedef struct net_protocol {
struct net_protocol *next;
struct net_protocol_module_info *module;
@@ -77,6 +79,13 @@ struct net_protocol_module_info {
ssize_t (*process_ancillary_data)(net_protocol *self,
const ancillary_data_header *header, const void *data,
void *buffer, size_t bufferSize);
ssize_t (*send_data_no_buffer)(net_protocol *self, const iovec *vecs,
size_t vecCount, ancillary_data_container *ancillaryData,
const struct sockaddr *address, socklen_t addressLength);
ssize_t (*read_data_no_buffer)(net_protocol *self, const iovec *vecs,
size_t vecCount, ancillary_data_container **_ancillaryData,
struct sockaddr *_address, socklen_t *_addressLength);
};
#endif // NET_PROTOCOL_H