[mpls-linux-general] ldp hello message padding
Status: Beta
Brought to you by:
jleu
|
From: a a <dre...@ho...> - 2003-07-28 20:49:18
|
Hi!
I don't know where to post this message besides this forum...
I am about to create a midleware between an architecture/protocl named
SelNet and MPLS.
In order to do this I need to hack some stuff with LDP and have therefore
investigated mpls_linux and ldp_portable...
Now, I'm at the point where I'm about to start send ldp messages over the
wire and I have gotten some strange problems here.
I.e. when I send a hello message a struct that should be 10 bytes becomes 12
bytes due to padding to an even word-length...
Eg.
typedef struct test_s {
u_short16_t foo; // 2 bytes
u_short16_t bar; // 2 bytes
u_short16_t id; // 2 bytes
u_iint32_t whatever; // 4 bytes
} test_t;
// total size should be 10 bytes:
int main(int argc, char** argv)
{
printf("sizeof(test_t): %d\n", sizeof(test_t)); // will print
sizeof(test_t): 12
return 0;
}
Do anyone know how to get around this stuff? Since it has been done in
ldp_portable it should be a way, but I'm sorta stuck. :(
Pls help!
Sincerly,
Drew
_________________________________________________________________
Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/
|