aboutsummaryrefslogtreecommitdiff
path: root/contrib/bsnmp/snmpd/trans_inet.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bsnmp/snmpd/trans_inet.c')
-rw-r--r--contrib/bsnmp/snmpd/trans_inet.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/contrib/bsnmp/snmpd/trans_inet.c b/contrib/bsnmp/snmpd/trans_inet.c
index dccfb6234222..d06b85ac11f6 100644
--- a/contrib/bsnmp/snmpd/trans_inet.c
+++ b/contrib/bsnmp/snmpd/trans_inet.c
@@ -375,17 +375,16 @@ inet_recv(struct tport *tp, struct port_input *pi)
* \param tp port
* \param buf data to send
* \param len number of bytes to send
- * \param addr destination address
- * \param addlen destination address length
+ * \param pi destination
*
* \return number of bytes sent
*/
static ssize_t
-inet_send2(struct tport *tp, const u_char *buf, size_t len,
+inet_send(struct tport *tp, const u_char *buf, size_t len,
struct port_input *pi)
{
struct inet_port *p = __containerof(tp, struct inet_port, tport);
- struct port_sock *s = (pi == NULL) ? TAILQ_FIRST(&p->socks) :
+ struct port_sock *s = (pi->fd == -1) ? TAILQ_FIRST(&p->socks) :
__containerof(pi, struct port_sock, input);
struct iovec iov;
@@ -414,15 +413,14 @@ inet_send2(struct tport *tp, const u_char *buf, size_t len,
/** exported to daemon */
const struct transport_def inet_trans = {
- "inet",
- OIDX_begemotSnmpdTransInet,
- inet_start,
- inet_stop,
- inet_destroy_port,
- inet_activate,
- NULL,
- inet_recv,
- inet_send2,
+ .name = "inet",
+ .id = OIDX_begemotSnmpdTransInet,
+ .start = inet_start,
+ .stop = inet_stop,
+ .close_port = inet_destroy_port,
+ .init_port = inet_activate,
+ .recv = inet_recv,
+ .send = inet_send,
};
struct inet_port_params {