|
From: Bob T. <bt...@us...> - 2004-08-02 19:18:35
|
Update of /cvsroot/benson/benson3/src/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11459/src/network Modified Files: v31_network_request.c Log Message: Fixed many show stopping things. Index: v31_network_request.c =================================================================== RCS file: /cvsroot/benson/benson3/src/network/v31_network_request.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** v31_network_request.c 16 Dec 2003 16:17:46 -0000 1.10 --- v31_network_request.c 2 Aug 2004 19:18:26 -0000 1.11 *************** *** 4,9 **** ! int process_trap_v31(bnet_req_v31 *req_pkt, SV* server_ref) { char destination[DST_MAXSIZE_v31]; char agent[AGT_MAXSIZE_v31]; --- 4,10 ---- ! int process_trap_v31(bnet_req_v31 *req_pkt, SV* server_ref, bn_netaccept_ctx *conn_ctx) { + char *peer_ipaddr; char destination[DST_MAXSIZE_v31]; char agent[AGT_MAXSIZE_v31]; *************** *** 12,15 **** --- 13,18 ---- char message[MSG_MAXSIZE_v31]; char status[STA_MAXSIZE_v31]; + struct sockaddr_in peer_addr; + int peer_length; SV *alert_ref; SV *result; *************** *** 23,26 **** --- 26,32 ---- safe_strncpy(status, "initial", STA_MAXSIZE_v31); + getpeername(conn_ctx->connfd, (struct sockaddr *)&peer_addr, &peer_length); + peer_ipaddr = inet_ntoa(peer_addr.sin_addr); + ENTER; SAVETMPS; *************** *** 29,32 **** --- 35,39 ---- bn_require_module("Benson::Handlers::Network::Submit"); alert_ref = sv_2mortal(bn_new_object("Benson::Alert", 0)); + bn_set_attribute(alert_ref, "peer_ipaddr", newSVpv(peer_ipaddr,0)); bn_set_attribute(alert_ref, "destination", newSVpv(destination, 0)); bn_set_attribute(alert_ref, "agent", newSVpv(agent, 0)); *************** *** 187,191 **** printf("benson trap received\n"); ! rc = process_trap_v31(&req_pkt, server_ref); resp_hdr.resp.trap.rc = htons(rc); --- 194,198 ---- printf("benson trap received\n"); ! rc = process_trap_v31(&req_pkt, server_ref, conn_ctx); resp_hdr.resp.trap.rc = htons(rc); |