Esempio n. 1
0
extern void
proto_session_hdr_marshall(Proto_Session *s, Proto_Msg_Hdr *h){
  // ignore the version number and hard code to the version we support
  s->shdr.version = PROTOCOL_BASE_VERSION;
  proto_session_hdr_marshall_type(s, h->type);
  proto_session_hdr_marshall_sver(s, h->sver);
  proto_session_hdr_marshall_pstate(s, &h->pstate);
  proto_session_hdr_marshall_gstate(s, &h->gstate);
  // we ignore the body length as we will explicity set it
  // on the send path to the amount of body data that was
  // marshalled.
}
Esempio n. 2
0
extern void
proto_session_hdr_marshall(Proto_Session *s, Proto_Msg_Hdr *h)
{
  // ignore the version number and hard code to the version we support

  if (h->version>0)
    s->shdr.version = htonl(h->version);
  else  
    s->shdr.version = htonl(PROTOCOL_BASE_VERSION);
  proto_session_hdr_marshall_type(s, h->type);
  proto_session_hdr_marshall_sver(s, h->sver);
  proto_session_hdr_marshall_returnCode(s, h->returnCode);
  proto_session_hdr_marshall_game(s, &h->game);
  proto_session_hdr_marshall_updatecell(s, h->updateCell);
  // we ignore the body length as we will explicity set it
  // on the send path to the amount of body data that was
  // marshalled.
}