Using Finite state machine for Protocol design

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Re: Using Finite state machine for Protocol design

    > 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).
    To ADD to my previous mail:
    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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default Re: Using Finite state machine for Protocol design

    On Thu, 31 Jul 2003 12:34:37 -0400, Shashank Khanvilkar wrote:
    >> 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).
    > To ADD to my previous mail:
    > 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?
    An easy technique is to just do something like:

    #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

  4. #3

    Default 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...
    > 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 know of libero [url]http://www.imatix.com/html/libero/[/url] , which can generate code for many different languages.
    And are also Patterns in the GoF (Gang of Four) Book ("Design Patterns") which might fit.

    HTH

    Martin

    Martin Jost Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139