--- amp.h 2001/08/23 12:24:47 1.1
+++ amp.h 2001/08/23 12:34:40 1.2
@@ -9,19 +9,25 @@
typedef struct
{
- int (*listen)(int s, int backlog);
- int (*accept)(int s, struct sockaddr *addr, socklen_t *addrlen);
- int (*bind)(int s, const struct sockaddr *addr, socklen_t addrlen);
- ssize_t (*read)(int d, void *buf, size_t nbytes);
- ssize_t (*readv)(int d, const struct iovec *iov, int iovcnt);
- ssize_t (*write)(int d, const void* buf, size_t nbytes);
- ssize_t (*writev)(int d, const struct iovec* iov, int iovcnt);
+ int (*listen) (int fd, int backlog);
+ int (*accept) (int fd, struct sockaddr *addr, socklen_t *addrlen);
+ int (*bind) (int fd, const struct sockaddr *addr, socklen_t addrlen);
+ ssize_t (*read) (int fd, void *buf, size_t nbytes);
+ ssize_t (*readv) (int fd, const struct iovec *iov, int iovcnt);
+ ssize_t (*write) (int fd, const void* buf, size_t nbytes);
+ ssize_t (*writev) (int fd, const struct iovec* iov, int iovcnt);
+ ssize_t (*send)(int s, const void *msg, size_t len, int flags);
+ ssize_t (*sendto)(int s, const void *msg, size_t len, int flags,
+ const struct sockaddr *to, socklen_t tolen);
+ ssize_t (*recv)(int s, void *buf, size_t len, int flags);
+ ssize_t (*recvfrom)(int s, void *buf, size_t len, int flags, struct sockaddr *from,
+ socklen_t *fromlen);
}
amp_engine_t;
typedef struct
{
- int fd;
+ int fd;
amp_engine_t engine;
}
amp_peer_t;
@@ -29,4 +35,7 @@
amp_peer_t* amp_create_peer(const char* engine, const char* peer);
int amp_destroy_peer(amp_peer_t* peer);
+int amp_send(amp_peer_t* peer, const void* msg, size_t msg_len);
+int amp_receive(amp_peer_t* peer, const void** msg, size_t* msg_len);
+
#endif /* !defined(__LIBAMP_H__) */
|