File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / ucb / talk / print.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:29:26 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21

/* $Header: /var/lib/cvsd/repos/cci/cci/usr/src/ucb/talk/print.c,v 1.1.1.1 2019/07/28 12:29:26 root Exp $ */

/* debug print routines */

#include <stdio.h>
#include "ctl.h"

print_request(request)
CTL_MSG *request;
{
    
    printf("  type is %d, l_user %s, r_user %s, r_tty %s,",
	    request->ctlm_type, request->ctlm_l_name, request->ctlm_r_name,
	    request->ctlm_r_tty);
    printf("id = %d", request->ctlm_id_num);
    printf("sender's address ");
    print_addr(request->ctlm_ctl_addr);
    fflush(stdout);
}

print_response(response)
CTL_RESPONSE *response;
{
    printf("type is %d, answer is %d, id = %d\n\n", response->ctlr_type, 
	    response->ctlr_answer, response->ctlr_id_num);
    fflush(stdout);
}

/* print_addr is a debug print routine. moved from ctl.c */

print_addr(addr)
struct sockaddr_in addr;
{
    int i;

    printf("addr = %x, port = %d, family = %o ",
	    addr.sin_addr, addr.sin_port, addr.sin_family);

/*    for (i = 0; i<8;i++) {
/*	printf("%o ", (int)addr.sin_zero[i]);
/*   }
/**/
    putchar('\n');
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.