##
## Place your ethernet IP-address instead of AAA.BBB.CCC.DDD
##

TUNNEL_SRC_IP=AAA.BBB.CCC.DDD


GRE_MODULE=/kernel/strmod/gre

# 64bit sparc sun compiler
# CC=cc -fast -xarch=v9 -D_KERNEL -DSUNDDI -I.

# 32bit
CC=gcc -O6 -D_KERNEL -DSUNDDI -I.

LD=ld -r

gre: gre.c gre.h
	${CC} gre.c -c -o gre.o
	${LD} gre.o -o gre

clean:
	rm -f gre gre.o

install: gre
	cp gre ${GRE_MODULE}

load:
	/usr/sbin/modload ${GRE_MODULE}

unload:
	/usr/sbin/modunload -i `/usr/sbin/modinfo |/usr/bin/grep "cisco GRE" |/usr/bin/nawk '{ print $1 }'`	

plumb:
	/usr/sbin/ifconfig ip.gre0 plumb 127.0.0.2 tsrc ${TUNNEL_SRC_IP} up

unplumb:
	/usr/sbin/ifconfig ip.gre0 down unplumb
