Annotation of researchv8dc/sys/chaosld/chset.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  *             C H  S E T
                      3:  *
                      4:  * Chaosnet line discipline - routines to set various fields in a packet.
                      5:  *
                      6:  *
                      7:  * (c) Copyright 1984  Nirvonics, Inc.
                      8:  *
                      9:  * Written by Kurt Gollhardt
                     10:  * Last update Wed Oct 24 13:39:42 1984
                     11:  *
                     12:  * This software is the property of Nirvonics, Inc.
                     13:  * All rights reserved.
                     14:  *
                     15:  */
                     16: 
                     17: #include "ch.h"
                     18: #if NCH > 0
                     19: #include "../h/param.h"
                     20: #include "../h/systm.h"
                     21: #include "../h/stream.h"
                     22: #include "../h/conf.h"
                     23: #include "../chaosld/types.h"
                     24: #include "../chaosld/constants.h"
                     25: #include "../chaosld/globals.h"
                     26: 
                     27: 
                     28: /*
                     29:  * Set (STS) status info in a packet, reflecting the current state
                     30:  * of the connection.
                     31:  */
                     32: setsts(conn, pkt)
                     33:      register struct connection    *conn;
                     34:      register struct packet        *pkt;
                     35: {
                     36:      register struct block         *bp;
                     37:      register struct sts_data      sts;
                     38: 
                     39:      free_pkdata(pkt);
                     40:      pkt->pk_op = STSOP;
                     41:      pkt->pk_ackn = conn->cn_racked = conn->cn_rread;
                     42:      sts.sts_receipt = conn->cn_rlast;
                     43:      sts.sts_rwsize = conn->cn_rwsize;
                     44:      append_packet(pkt, &sts, sizeof(sts));
                     45: }
                     46: 
                     47: 
                     48: /*
                     49:  * Set connection info fields in a packet.
                     50:  * Many routines count on the fact that this clears pk_type and next.
                     51:  */
                     52: setconn(conn, pkt)
                     53: register struct connection *conn;
                     54: register struct packet *pkt;
                     55: {
                     56:        pkt->pk_daddr = conn->cn_faddr;
                     57:        pkt->pk_didx = conn->cn_fidx;
                     58:        pkt->pk_saddr = Chmyaddr;
                     59:        pkt->pk_sidx = conn->cn_lidx;
                     60:        pkt->pk_type = 0;
                     61:        pkt->next = NOPKT;
                     62:        pkt->pk_fc = 0;
                     63: }
                     64: 
                     65: 
                     66: /*
                     67:  * Set acknowledge field of packet from connection.
                     68:  */
                     69: setack(conn, pkt)
                     70:      struct connection   *conn;
                     71:      struct packet       *pkt;
                     72: {
                     73:      pkt->pk_ackn = conn->cn_racked = conn->cn_rread;
                     74: }
                     75: 
                     76: #endif

unix.superglobalmegacorp.com

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