Ask a Question related to UNIX Programming, Design and Development.
-
Shashank Khanvilkar #1
Re: Using Finite state machine for Protocol design
> Hi,
To ADD to my previous mail:> Will really appreciate for any comments on the below:
>
> Are there any Open Source tools that can convert a protocol design, as a
> Finite State Machine,
> directly to C code. (I can, of course, google for it, but I would like to
> get comments from people who
> have used such tools and how effective they are).
I have also found out in many codes, that they use function pointers for
different types of messages. Thus many people define a structure for
expected messages, which has a pointer to a function which deals with the
particular message, which , in my opinion is pretty neat.
Comments?
>
> --
> Regards
> Shashank
> [url]http://mia.ece.uic.edu/~papers[/url]
>
>
Shashank Khanvilkar Guest
-
Session state IIS (Machine Key | Load Balanced Session)
This is a classic ASP group. Try microsoft.public.dotnet.framework.aspnet "Fred" <me@me.com> wrote in message... -
login that accesses remopte db wont work on that machine but works while on my local machine????!! HELP!
I knocked up a simple login for a CMS for one of my sites.... now itr will work fine and authemticate with data on the online server by the IP... -
finite state machines
Hi Can anyone help me? I am taking a computer science course. I have to stimulate a binary adder for a computer that uses 16 bit registers Do... -
Setting a default state for Multi-State buttons
I'm using the multi-state button behavior and would like to have one button set ON as the default when the app first runs. Is it possible to set the... -
How to duplicate whole database from one machine to another machine in Windows 2000?
Would you please what files I have to copy? Thanks. "Ban Spam" <ban-spam@operamail.com> wrote in message... -
Michael B Allen #2
Re: Using Finite state machine for Protocol design
On Thu, 31 Jul 2003 12:34:37 -0400, Shashank Khanvilkar wrote:
An easy technique is to just do something like:> To ADD to my previous mail:>> Hi,
>> Will really appreciate for any comments on the below:
>>
>> Are there any Open Source tools that can convert a protocol design, as
>> a Finite State Machine,
>> directly to C code. (I can, of course, google for it, but I would like
>> to get comments from people who
>> have used such tools and how effective they are).
> I have also found out in many codes, that they use function pointers for
> different types of messages. Thus many people define a structure for
> expected messages, which has a pointer to a function which deals with
> the particular message, which , in my opinion is pretty neat. Comments?
#define CMD_FOO 0x01
#define CMD_BAR 0x02
typedef int (*cmd_handler_fn)(struct server *svr, struct client *cli, cmd_t req, cmd_t resp);
struct {
char *name;
cmd_handler_fn handler_fn;
} cmd_tbl[] = {
{ "", NULL },
{ "CMD_FOO", foo_handler },
{ "CMD_BAR", bar_handler }
};
int
loop(struct server *svr)
{
cmd_t req, resp;
cli = select(...);
req = decode_msg(cli->fd);
cmd_tbl[req->cmd].handler_fn(svr, cli, req, resp);
}
Although I am sort of winging it at the end here it's probably a sound
design. If you need high performance you may need to think about how to
handler requests concurrently though.
Mike
Michael B Allen Guest
-
Martin Jost #3
Re: Using Finite state machine for Protocol design
"Shashank Khanvilkar" <shashank@evl.uic.edu> schrieb im Newsbeitrag news:bgbflm$88q$1@newsx.cc.uic.edu...I know of libero [url]http://www.imatix.com/html/libero/[/url] , which can generate code for many different languages.> Hi,
> Will really appreciate for any comments on the below:
>
> Are there any Open Source tools that can convert a protocol design, as a
> Finite State Machine,
> directly to C code. (I can, of course, google for it, but I would like to
> get comments from people who
> have used such tools and how effective they are).
And are also Patterns in the GoF (Gang of Four) Book ("Design Patterns") which might fit.
HTH
Martin
Martin Jost Guest



Reply With Quote

