[Spice-devel] [PATCH v4 09/41] proto: Decorate protocol file with attributes for wireshark

Frediano Ziglio fziglio at redhat.com
Thu Jul 30 08:58:13 PDT 2015


> 
> On Thu, Jul 23, 2015 at 04:54:26PM +0100, Frediano Ziglio wrote:
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  spice.proto | 416
> >  ++++++++++++++++++++++++++++++++----------------------------
> >  1 file changed, 219 insertions(+), 197 deletions(-)
> > 
> > diff --git a/spice.proto b/spice.proto
> > index 4ea1263..52d6971 100644
> > --- a/spice.proto
> > +++ b/spice.proto
> > @@ -5,14 +5,14 @@
> >  typedef fixed28_4 int32 @ctype(SPICE_FIXED28_4);
> >  
> >  struct Point {
> > -    int32 x;
> > -    int32 y;
> > -};
> > +    int32 x @ws("x", point32.x);
> > +    int32 y @ws("y", point32.y);
> > +} @ws_txt("POINT (%d, %d)", x, y);
> >  
> >  struct Point16 {
> > -    int16 x;
> > -    int16 y;
> > -};
> > +    int16 x @ws("x", point16.x);
> > +    int16 y @ws("y", point16.y);
> > +} @ws_txt("POINT16 (%d, %d)", x, y);
> >  
> >  struct PointFix {
> >      fixed28_4 x;
> > @@ -20,11 +20,14 @@ struct PointFix {
> >  };
> >  
> >  struct Rect {
> > -    int32 top;
> > -    int32 left;
> > -    int32 bottom;
> > -    int32 right;
> > -};
> > +    int32 top @ws("top", rect.top);
> > +    int32 left @ws("left", rect.left);
> > +    int32 bottom @ws("bottom", rect.bottom);
> > +    int32 right @ws("right", rect.right);
> > +}
> > + at ws_txt("RECT: (%d-%d, %d-%d)", left, top, right, bottom)
> > + at ws_txt_n("RECT %u: (%d-%d, %d-%d)", INDEX, left, top, right, bottom)
> > +;
> >  
> >  struct Transform {
> >      uint32 t00;
> > @@ -96,10 +99,15 @@ enum32 notify_visibility {
> >  };
> >  
> >  flags16 mouse_mode {
> > -    SERVER,
> > -    CLIENT,
> > +    SERVER @ws_desc("Server mode"),
> > +    CLIENT @ws_desc("Client mode"),
> >  };
> >  
> > +flags32 mouse_mode32 {
> > +    SERVER @ws_desc("Server mode"),
> > +    CLIENT @ws_desc("Client mode"),
> > +} @ws("Supported mouse modes", supported_mouse_modes);
> > +
> 
> This one should be split as this is an addition rather than a decoration
> 

Yes, perhaps was added before the ws_as implementation (actually I'm not sure it works for primitive types).

...

Frediano


More information about the Spice-devel mailing list