pfkey.c (b5ff185e19f6013ca565b2a15bc2d6abce933f46) | pfkey.c (d19ba08a1672cf3d710ed46e897690c16f0282c6) |
---|---|
1/* $NetBSD: inet.c,v 1.35.2.1 1999/04/29 14:57:08 perry Exp $ */ 2/* $KAME: ipsec.c,v 1.25 2001/03/12 09:04:39 itojun Exp $ */ 3/*- 4 * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 87 unchanged lines hidden (view full) --- 96}; 97 98static const char *pfkey_msgtype_names (int); 99 100 101static const char * 102pfkey_msgtype_names(int x) 103{ | 1/* $NetBSD: inet.c,v 1.35.2.1 1999/04/29 14:57:08 perry Exp $ */ 2/* $KAME: ipsec.c,v 1.25 2001/03/12 09:04:39 itojun Exp $ */ 3/*- 4 * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 87 unchanged lines hidden (view full) --- 96}; 97 98static const char *pfkey_msgtype_names (int); 99 100 101static const char * 102pfkey_msgtype_names(int x) 103{ |
104 const int max = 105 sizeof(pfkey_msgtypenames)/sizeof(pfkey_msgtypenames[0]); | 104 const int max = nitems(pfkey_msgtypenames); |
106 static char buf[20]; 107 108 if (x < max && pfkey_msgtypenames[x]) 109 return pfkey_msgtypenames[x]; 110 snprintf(buf, sizeof(buf), "#%d", x); 111 return buf; 112} 113 --- 95 unchanged lines hidden --- | 105 static char buf[20]; 106 107 if (x < max && pfkey_msgtypenames[x]) 108 return pfkey_msgtypenames[x]; 109 snprintf(buf, sizeof(buf), "#%d", x); 110 return buf; 111} 112 --- 95 unchanged lines hidden --- |