summaryrefslogtreecommitdiff
path: root/lib/libc/net/ether_addr.c
Commit message (Collapse)AuthorAgeFilesLines
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* libc: do not include <sys/types.h> where <sys/param.h> was already includedAndriy Voskoboinyk2016-04-181-1/+0
| | | | | | | | | According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <sys/types.h> when LOCORE is not defined). Notes: svn path=/head/; revision=298226
* Make ether_line really report an error when all input is invalid.Julio Merino2014-03-121-5/+7
| | | | | | | | | | | | | | | The previous code failed to return an error condition when the whole input was invalid due to improper handling of the sscanf return value. Actually, this failure was properly being caught by a test in tools/regression/lib/libc/net/test-ether.t but was not noticed because these tests are never run. (On my way to fixing that ;-) The fix applied here resembles the implementation of ether_line in NetBSD modulo the setting of an errno value (which is not documented as an expectation in the manpage anyway). Notes: svn path=/head/; revision=263090
* libc: Make various internal file descriptors from fopen() close-on-exec.Jilles Tjoelker2013-08-231-2/+2
| | | | Notes: svn path=/head/; revision=254700
* Add and document ether_ntoa_r() and ether_aton_r() functions, which acceptRobert Watson2007-05-131-25/+40
| | | | | | | | | passed storage buffers rather than using static storage. Reimplement ether_ntoa() and ether_aton() in terms of these functions. These variants are thread-safe. Notes: svn path=/head/; revision=169522
* Move to more conformant style(9) before making functional changes.Robert Watson2007-05-131-51/+35
| | | | Notes: svn path=/head/; revision=169520
* Fix style of ether_ntoa().Ruslan Ermilov2002-04-081-3/+3
| | | | Notes: svn path=/head/; revision=94174
* Polish previous revision.Ruslan Ermilov2002-04-061-1/+1
| | | | Notes: svn path=/head/; revision=93956
* Fix ether_ntoa() to generate the %02x format people expect, instead of %x,Matthew Dillon2002-04-061-2/+3
| | | | | | | | | for the ethernet address. MFC after: 1 day Notes: svn path=/head/; revision=93929
* Add a carriage return to each function declaration, and make use of ID tagEric Melville2002-03-061-8/+12
| | | | | | | | | macros. MFC after: 1 day Notes: svn path=/head/; revision=91725
* Const'ify parameters to ethers(3) routines as appropriate.Archie Cobbs2000-07-181-5/+5
| | | | Notes: svn path=/head/; revision=63474
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Small yet significant tweaks/cleanups:Bill Paul1996-12-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - getservent: o put _yp_check() proto under #ifdef YP where it belongs o local YP buffers should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying - gethostbynis: o local YP buffer should be YPMAXRECORD + 2 bytes long - getnetbynis: o local YP buffer should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying - ether_addr: o local YP buffers should be YPMAXRECORD + 2 bytes long and should be NUL terminated after copying (in this case it's BUFSIZ + 2 bytes, but it happens that BUFSIZ == YPMAXRECORD. - gethostbydns: o nuke stray 'return(NULL)' in __dns_getanswer() (harmless but looks silly) These are 2.2 candidates. I will wait a few days to make sure these don't break anything and then, if there are no objections, move them to the 2.2 branch. Notes: svn path=/head/; revision=20953
* Get struct ether_addr directly from <net/ethernet.h> rather than pullingGarrett Wollman1996-12-101-4/+2
| | | | | | | | | in lots of unrelated junk from <net/if.h> and <net/if_ether.h>. These functions still aren't prototyped anywhere (but should be in <net/ethernet.h>---got that, Bill?). Notes: svn path=/head/; revision=20288
* Remove more instances of passing arrays by address when they shouldJordan K. Hubbard1996-12-051-7/+7
| | | | | | | | have simply been passed as arrays. In some cases, casts had even been added to remove the warnings generated by such misuse! Aieee! Notes: svn path=/head/; revision=20164
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-3/+12
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* gethostbynis.c:Bill Paul1996-03-161-3/+1
| | | | | | | | | | | | | | | | | | | | | - Fix problem described in PR #1079: _gethostbynisaddr() doesn't work. Make it accept the same arguments as all the other gethostby*addr() functions and properly convert the supplied IP address into a text string so that yp_match() can find it in the hosts.byaddr map. - Also fix potential memory leak: copy the results of yp_match() to a static buffer and free the result (yp_match() returns dynamically allocated memory). ether_addr.c: - Since I was in the neighborhood, fix ether_ntohost() and ether_hostton() so that they don't bogusly for a free(result) when yp_match() fails. Notes: svn path=/head/; revision=14639
* Just when you thought it was safe...Bill Paul1995-08-071-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - getnetgrent.c: address some NIS compatibility problems. We really need to use the netgroup.byuser and netgroup.byhost maps to speed up innetgr() when using NIS. Also, change the NIS interaction in the following way: If /etc/netgroup does not exist or is empty (or contains only the NIS '+' token), we now use NIS exclusively. This lets us use the 'reverse netgroup' maps and is more or less the behavior of other platforms. If /etc/netgroup exists and contains local netgroup data (but no '+'). we use only lthe local stuff and ignore NIS. If /etc/netgroup exists and contains both local data and the '+', we use the local data nd the netgroup map as a single combined database (which, unfortunately, can be slow when the netgroup database is large). This is what we have been doing up until now. Head off a potential NULL pointer dereference in the old innetgr() matching code. Also fix the way the NIS netgroup map is incorporated into things: adding the '+' is supposed to make it seem as though the netgroup database is 'inserted' wherever the '+' is placed. We didn't quite do it that way before. (The NetBSD people apparently use a real, honest-to-gosh, netgroup.db database that works just like the password database. This is actually a neat idea since netgroups is the sort of thing that can really benefit from having multi-key search capability, particularly since reverse lookups require more than a trivial amount of processing. Should we do something like this too?) - netgroup.5: document all this stuff. - rcmd.c: some sleuthing with some test programs linked with my own version of innetgr() has revealed that SunOS always passes the NIS domain name to innetgr() in the 'domain' argument. We might as well do the same (if YP is defined). - ether_addr.c: also fix the NIS interaction so that placing the '+' token in the /etc/ethers file makes it seem like the NIS ethers data is 'inserted' at that point. (Chances are nobody will notice the effect of this change, which is just te way I like it. :) Notes: svn path=/head/; revision=9978
* Add ether_addr functions to libc. This seems to be the logical placeBill Paul1995-04-021-0/+234
to put them. A man page is in the works. Notes: svn path=/head/; revision=7576