Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jan 1999 11:10:08 -0800 (PST)
From:      Archie Cobbs <archie@whistle.com>
To:        phk@critter.freebsd.dk (Poul-Henning Kamp)
Cc:        julian@whistle.com, net@FreeBSD.ORG
Subject:   Re: netgraph...
Message-ID:  <199901301910.LAA09983@bubba.whistle.com>
In-Reply-To: <9165.917685127@critter.freebsd.dk> from Poul-Henning Kamp at "Jan 30, 99 09:32:07 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp writes:
> >The point is that you avoid having to parse ASCII strings
> >for *every* control message.
> 
> I simply don't understand why we can't have a single type of
> controlmessage that means
> 
> "Here is an ascii string to you from the super-user, do
> whatever he tells you to, thankyou!"
> 
> That's what I'm asking for, no more, no less.

(why is this so hard to communicate)

Are you saying you really don't understand, or you just weigh the
priorities differently?

The reason is:

It's important that control message delivery between nodes be as
fast as possible (read: no encoding/decoding between binary and
ASCII for every message). This is so we can support situations
where there are hundreds of these messages flying around per second,
ie, for flow control or whatever.

Maybe you don't care as much about this, but I do..

BUT, we can satisfy your need as well. We'll add a new base function:

  extern int  ng_send_ascii_msg(node_p here, const char *path
	        const char *asciimsg, struct ng_mesg **rptr);

This function will simply do this:

  int
  ng_send_ascii_msg(ode_p here, const char *path
		  const char *asciimsg, struct ng_mesg **rptr)
  {
    struct ng_mesg decode_msg, *decode_reply;
    int error;

    NG_MKMESSAGE(decode_msg, NGM_GENERIC_COOKIE, NGM_DECODE_MSG,
      asciimsg, strlen(asciimsg));
    error = ng_send_msg(here, decode_msg, path, &decode_reply);
    if (error != 0)
      return(error);
    return (ng_send_msg(here, decode_reply, path, rptr));
  }

So the sender can chose how they want to encode their message.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901301910.LAA09983>