/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 2000-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* Phong Vo <[email protected]> *18* *19***********************************************************************/20#pragma prototyped2122#include <ast.h>23#include <bgp.h>2425#define TOTAL (2*1024)26#define ALIGN 162728int29main()30{31Bgproute_t bgp;32unsigned int total;33unsigned int fixed;34unsigned int pad;35unsigned int data;3637total = sizeof(Bgproute_t);38fixed = offsetof(Bgproute_t, pad);39if (!(pad = ALIGN - fixed % ALIGN))40pad = ALIGN;41data = TOTAL - (fixed + pad);42if (total == TOTAL && pad == sizeof(bgp.pad) && data == sizeof(bgp.data))43sfprintf(sfstdout, "%u\n", total);44else45sfprintf(sfstdout, "edit bgp.h and adjust padding dimensions to pad[%u] and data[%u] for data aligned to %d bytes and a total size of %u\n", pad, data, ALIGN, TOTAL);46return 0;47}484950