Questions tagged [xdr]

XDR (eXternal Data Representation) is a standard for the description and encoding of data. It is useful for transferring data between different computer architectures, and has been used to communicate data between such diverse machines as the SUN WORKSTATION, VAX, IBM-PC, and Cray. It underlies NFS.

XDR fits into the ISO presentation layer, and is roughly analogous in purpose to X.409, ISO Abstract Syntax Notation. The major difference between these two is that XDR uses implicit typing, while X.409 uses explicit typing.

XDR uses a language to describe data formats. The language can only be used only to describe data; it is not a programming language. This language allows one to describe intricate data formats in a concise manner. The alternative of using graphical representations (itself an informal language) quickly becomes incomprehensible when faced with complexity. The XDR language itself is similar to the C language [1], just as Courier [4] is similar to Mesa. Protocols such as ONC RPC (Remote Procedure Call) and the NFS* (Network File System) use XDR to describe the format of their data.

The XDR standard makes the following assumption: that bytes (or octets) are portable, where a byte is defined to be 8 bits of data. A given hardware device should encode the bytes onto the various media in such a way that other hardware devices may decode the bytes without loss of meaning. For example, the Ethernet* standard suggests that bytes be encoded in "little-endian" style [2], or least significant bit first.

63 questions
0
votes
1 answer

Save an integer array written in C to a JSON text file array

How would one go about saving an integer array written as a c file into a JSON text file array file? Any help or links would be greatly appreciated.
Jefe
  • 9
  • 1
  • 3
0
votes
1 answer

How to pack python dict to XDR

I have python dict: data = { 'foo': 'bar', 'hello': 'world' } How to can I pack this dict to XDR data format?
0
votes
1 answer

ssize_t data type in XDR for RPC

I am writing an RPC application. I need to use ssize_t data type in the C portion and it needs to be sent over the wire. What should I represent ssize_t as in the IDL? I can cast it to int but I want to know the correct way to do it than just…
powerrox
  • 1,334
  • 11
  • 21
0
votes
1 answer

rpc pointer not showing the right result

So I'm trying to use some RPC function. Basically I want to multiply 2 2*2 matrices, the client send 2 matrices the client calculates and sends the matrix. The matrix received in my client isn't the one I sent. // server.c matrice* multiply(matrice2…
Jérôme B
  • 311
  • 5
  • 18
0
votes
1 answer

Understanding second argument in the function "xdrmem_create"

I was debugging ganglia and came through sending data using XDR through UDP channel. I found the second argument of the function xdrmem_create ( xdrs, addr, size, op) strange. Where the syntax of the arguments are given as: XDR *xdrs; char…
Rohit
  • 604
  • 1
  • 10
  • 25
0
votes
1 answer

how to write xdr packed data in binary files

I want to convert an array into xdr format and save it in binary format. Here's my code: # myData is Pandas data frame, whose 3rd col is int (but it could anything else) import…
uday
  • 6,453
  • 13
  • 56
  • 94
0
votes
0 answers

Design of Python's xdrlib module

I have recently started to use Python's xdrlib module. I was surprised to see that Packer and Unpacker are classes that you need to instanciate and contains method like reset and get_buffer. Calls to Packer and Unpacker instance methods accumulate…
0
votes
1 answer

change from print to write file c

I have a code that reads an input from xdr file and shows the result on shell but I prefer that the program saves the results in a format I can read with geany or nano or others programs. The program: #include #include #include…
0
votes
1 answer

How to send an array inside a structure of XDR through socket

I'm trying to send chunks of data from a file using an array declared inside a structure through XDR. The idea is to establish a client server communication encoded with XDR. struck response{ float data[5]; bool error; }myreq; I may have to use…
fresh learner
  • 467
  • 4
  • 22
0
votes
1 answer

Send a XDR struct over a socket with C in Linux

I'm writing a server that send an XDR struct over a socket. Using Wireshark I see that my client correctly send an XDR message to the server BUT I don't see any data go from the server to the client. But the code seems to be correct as it is the…
user2467899
  • 583
  • 2
  • 6
  • 19
0
votes
1 answer

XDR Encode function

I have create, with rpcgen, these two file (.h and .c) with my own two structs (the environment is Linux and the programming language is C). The two structs are these below (this is the .h file): /* * Please do not edit this file. * It was…
user2467899
  • 583
  • 2
  • 6
  • 19
0
votes
3 answers

Use a struct in a header file [ C - Linux ]

I tried to use an external struct but when I compile my c code I obtained this message: subscripted value is neither array nor pointer nor vector. Why? messaggio.h struct Request { struct { u_int data_len; float *data_val; …
user2467899
  • 583
  • 2
  • 6
  • 19
0
votes
1 answer

Encode and send an XDR struct over a TCP socket (C - Linux)

I have to ask the question below: I have to send the following XDR message: struct Responde{ float numbers<>; bool end; } I know how to enconde array (xdr_array) and bool (xdr_bool) but how can I: 1) Encode the struct? 2) Send the struct over a…
user2467899
  • 583
  • 2
  • 6
  • 19
0
votes
1 answer

Difference B/W MS XML Schema vs XSD Schema

I have been dwindling around a while but could not find any tutorials or resources about an XML Schema provided by Microsoft in this link. It looks like:
Ankesh
  • 4,847
  • 4
  • 38
  • 76
0
votes
1 answer

"Access is denied" when attempting a cross domain connection to a JSON file

I'm getting access errors when trying to access JSON data on a server not in my domain. I've tried to activate the cross-domain capabilities by jQuery.support.cors = true; but still got the same problem. Then I found this example page and this…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438