1 2/* 3 * ng_ether.c 4 * 5 * Copyright (c) 1996-2000 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 23 unchanged lines hidden (view full) --- 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 * 37 * Authors: Archie Cobbs <archie@freebsd.org> 38 * Julian Elischer <julian@freebsd.org> 39 * |
40 * $FreeBSD: head/sys/netgraph/ng_ether.c 65305 2000-09-01 00:28:03Z archie $ |
41 */ 42 43/* 44 * ng_ether(4) netgraph node type 45 */ 46 47#include <sys/param.h> 48#include <sys/systm.h> --- 680 unchanged lines hidden (view full) --- 729 730static int 731ng_enaddr_unparse(const struct ng_parse_type *type, 732 const u_char *data, int *off, char *cbuf, int cbuflen) 733{ 734 int len; 735 736 len = snprintf(cbuf, cbuflen, "%02x:%02x:%02x:%02x:%02x:%02x", |
737 data[*off], data[*off + 1], data[*off + 2], 738 data[*off + 3], data[*off + 4], data[*off + 5]); |
739 if (len >= cbuflen) 740 return (ERANGE); 741 *off += ETHER_ADDR_LEN; 742 return (0); 743} 744 745/****************************************************************** 746 INITIALIZATION --- 60 unchanged lines hidden --- |