<commit_before>// @(#)root/proofd:$Id$
// Author: <NAME>  12/12/2005

/*************************************************************************
 * Copyright (C) 1995-2005, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// XProofProtUtils.cxx                                                  //
//                                                                      //
// Authors: <NAME>, CERN 2005                                         //
//                                                                      //
// Utility functions prototypes for client-to-server                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifdef __APPLE__
#   ifndef __macos__
#      define __macos__
#   endif
#endif
#ifdef __sun
#   ifndef __solaris__
#      define __solaris__
#   endif
#endif
#ifndef WIN32
#  include <sys/types.h>
#  ifndef ROOT_XrdFour
#     include <netinet/in.h>
#  endif
#endif
#include "XrdSys/XrdSysPlatform.hh"
#include "XProofProtocol.h"
#include "XProofProtUtils.h"
#include "Bytes.h"


namespace XPD {

////////////////////////////////////////////////////////////////////////////////
/// This function applies the network byte order on those
/// parts of the 16-bytes buffer, only if it is composed
/// by some binary part
/// Return 0 if OK, -1 in case the ID is unknown

int clientMarshall(XPClientRequest* str)
{
   switch(str->header.requestid) {

   case kXP_login:
      str->login.pid = htonl(str->login.pid);
      break;
   case kXP_auth:
      // no swap on ASCII fields
      break;
   case kXP_create:
      // no swap on ASCII fields
      str->proof.int1 = htonl(str->proof.int1);
      break;
   case kXP_destroy:
      str->proof.sid = htonl(str->proof.sid);
      break;
   case kXP_attach:
      str->proof.sid = htonl(str->proof.sid);
      break;
   case kXP_detach:
      str->proof.sid = htonl(str->proof.sid);<commit_msg>Add missing include in XProofProtUtils.cxx<commit_after>// @(#)root/proofd:$Id$
// Author: <NAME>  12/12/2005

/*************************************************************************
 * Copyright (C) 1995-2005, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// XProofProtUtils.cxx                                                  //
//                                                                      //
// Authors: <NAME>, CERN 2005                                         //
//                                                                      //
// Utility functions prototypes for client-to-server                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifdef __APPLE__
#   ifndef __macos__
#      define __macos__
#   endif
#endif
#ifdef __sun
#   ifndef __solaris__
#      define __solaris__
#   endif
#endif
#ifndef WIN32
#  include <sys/types.h>
#  ifndef ROOT_XrdFour
#     include <netinet/in.h>
#  endif
#endif
#include "XrdSys/XrdSysPlatform.hh"
#include "XProofProtocol.h"
#include "XProofProtUtils.h"
#include "Bytes.h"

#include <cstdio>

namespace XPD {

////////////////////////////////////////////////////////////////////////////////
/// This function applies the network byte order on those
/// parts of the 16-bytes buffer, only if it is composed
/// by some binary part
/// Return 0 if OK, -1 in case the ID is unknown

int clientMarshall(XPClientRequest* str)
{
   switch(str->header.requestid) {

   case kXP_login:
      str->login.pid = htonl(str->login.pid);
      break;
   case kXP_auth:
      // no swap on ASCII fields
      break;
   case kXP_create:
      // no swap on ASCII fields
      str->proof.int1 = htonl(str->proof.int1);
      break;
   case kXP_destroy:
      str->proof.sid = htonl(str->proof.sid);
      break;
   case kXP_attach:
      str->proof.sid = htonl(str->proof.sid);
      break;
   case kXP_detach:
      str->proof.sid = htonl(str->proof.sid);
{'fraction_non_alphanumeric': 0.23536415955546736, 'fraction_numerical': 0.011113316134153601, 'mean_word_length': 1.0723684210526316, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6184617', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1154, 'n_words': 301}