Hi Sanjeev,

With much help from Dave Shield, I recently completed a port of netSNMP 5.1.1 to an embedded ARM system (XScale). I have attached a few files that
I used for configuration, etc.

cfg.sh is just a simple script where I setup all my config options. It should contain paths to your toolchain, library paths, etc.

route_patch.h is a file that I cobbled together to get around broken dependencies with the toochain I was using. You may or may not need it. If you do, stick it in agent/mibgroup/mibII. You'll need to edit include/net-snmp/net-snmp-config.h. Find the line "HAVE_NET_ROUTE_H" and comment this out. Any files in mibII that have this conditional define should be edited to include route_patch.h rather than route.h.

Also, if you're targetting a big-endian system, I found that I needed to edit libtool (in the root directory of net-snmp). Somewhere around line 1045 of this automatically generated file, there will be a line like :

compile_command = "$nonopt"

I modified this line to be :

compile_command = "$nonopt -mbig-endian"

Robert Story was rather alarmed by this previous change, but since it worked for me, I never bothered digging deeper for the true source of the problem :)

Ciao
Steve Comfort


Attachment: cfg.sh
Description: Bourne shell script

/* Temporary patch file to try and compile route_write for arm-linux */

#ifndef ROUTE_PATCH_H
#define ROUTE_PATCH_H

/* The following copied from <linux/route.h> */

#define STRUCT_RTENTRY_HAS_RT_DST 1

struct rtentry 
{
	unsigned long	rt_pad1;
	struct sockaddr	rt_dst;		/* target address		*/
	struct sockaddr	rt_gateway;	/* gateway addr (RTF_GATEWAY)	*/
	struct sockaddr	rt_genmask;	/* target network mask (IP)	*/
	unsigned short	rt_flags;
	short		rt_pad2;
	unsigned long	rt_pad3;
	void		*rt_pad4;
	short		rt_metric;	/* +1 for binary compatibility!	*/
	char		*rt_dev;	/* forcing the device at add	*/
	unsigned long	rt_mtu;		/* per route MTU/Window 	*/
#ifndef __KERNEL__
#define rt_mss	rt_mtu			/* Compatibility :-(            */
#endif
	unsigned long	rt_window;	/* Window clamping 		*/
	unsigned short	rt_irtt;	/* Initial RTT			*/
};

#define	RTF_UP		0x0001		/* route usable		  	*/
#define	RTF_GATEWAY	0x0002		/* destination is a gateway	*/
#define	RTF_HOST	0x0004		/* host entry (net otherwise)	*/
#define RTF_REINSTATE	0x0008		/* reinstate route after tmout	*/
#define	RTF_DYNAMIC	0x0010		/* created dyn. (by redirect)	*/
#define	RTF_MODIFIED	0x0020		/* modified dyn. (by redirect)	*/
#define RTF_MTU		0x0040		/* specific MTU for this route	*/
#define RTF_MSS		RTF_MTU		/* Compatibility :-(		*/
#define RTF_WINDOW	0x0080		/* per route window clamping	*/
#define RTF_IRTT	0x0100		/* Initial round trip time	*/
#define RTF_REJECT	0x0200		/* Reject route			*/

#ifndef atomic_t
typedef struct { volatile int counter; } atomic_t;
#endif

#endif

Reply via email to