1/* 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4 * All rights reserved. 5 * 6 * Author: Harti Brandt <harti@freebsd.org> 7 * 8 * Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $Begemot: bsnmp/snmpd/trap.c,v 1.9 2005/10/04 11:21:39 brandt_h Exp $ |
30 * 31 * TrapSinkTable 32 */ 33#include <sys/types.h> 34#include <sys/sysctl.h> 35#include <sys/un.h> 36#include <stdio.h> 37#include <stdlib.h> --- 64 unchanged lines hidden (view full) --- 102 sa.sin_family = AF_INET; 103 sa.sin_addr.s_addr = htonl((t->index.subs[0] << 24) | 104 (t->index.subs[1] << 16) | (t->index.subs[2] << 8) | 105 (t->index.subs[3] << 0)); 106 sa.sin_port = htons(t->index.subs[4]); 107 108 if (connect(t->socket, (struct sockaddr *)&sa, sa.sin_len) == -1) { 109 syslog(LOG_ERR, "connect(%s,%u): %m", |
110 inet_ntoa(sa.sin_addr), ntohs(sa.sin_port)); |
111 (void)close(t->socket); 112 free(t); 113 return (SNMP_ERR_GENERR); 114 } 115 116 if (tdep->set & TDEP_VERSION) 117 t->version = tdep->version; 118 if (tdep->set & TDEP_COMM) --- 348 unchanged lines hidden --- |