141edb306SCy Schubert /* 241edb306SCy Schubert * Copyright (C) 2012 by Darren Reed. 341edb306SCy Schubert * 441edb306SCy Schubert * See the IPFILTER.LICENCE file for details on licencing. 541edb306SCy Schubert * 641edb306SCy Schubert * $Id$ 741edb306SCy Schubert */ 841edb306SCy Schubert #include "ipf.h" 941edb306SCy Schubert 10efeb8bffSCy Schubert int geticmptype(int family,char * name)11efeb8bffSCy Schubertgeticmptype(int family, char *name) 1241edb306SCy Schubert { 1341edb306SCy Schubert icmptype_t *i; 1441edb306SCy Schubert 1541edb306SCy Schubert for (i = icmptypelist; i->it_name != NULL; i++) { 1641edb306SCy Schubert if (!strcmp(name, i->it_name)) { 1741edb306SCy Schubert if (family == AF_INET) 18*2582ae57SCy Schubert return (i->it_v4); 1941edb306SCy Schubert #ifdef USE_INET6 2041edb306SCy Schubert if (family == AF_INET6) 21*2582ae57SCy Schubert return (i->it_v6); 2241edb306SCy Schubert #endif 23*2582ae57SCy Schubert return (-1); 2441edb306SCy Schubert } 2541edb306SCy Schubert } 2641edb306SCy Schubert 27*2582ae57SCy Schubert return (-1); 2841edb306SCy Schubert } 29