Re: mac.c - Mailing list pgsql-hackers

From Alex Pilosov
Subject Re: mac.c
Date
Msg-id Pine.BSO.4.10.10008012259421.4362-100000@spider.pilosoft.com
Whole thread Raw
In response to mac.c  (Larry Rosenman <ler@lerctr.org>)
List pgsql-hackers
It appears to me that macaddr_manuf can be defined as this:

macaddr * macaddr_trunc (macaddr *addr)
{  macaddr *result;  if (addr==NULL) return NULL;  result=(macaddr *) palloc(sizeof(struct macaddr));
result->a=addr->a; result->b=addr->b;  result->c=addr->c;  result->d=0;  result->e=0;  result->f=0;  return result;
 
}

and then 

create function macaddr_trunc(macaddr) returns macaddr as 'MODULE_PATHNAME' language 'c';

and then
create function macaddr_manuf(macaddr) returns varchar2 as ' select name from macaddr_blah where mac=macaddr_trunc($1)
' language 'sql';

Be warned, this code was typed directly in editor and not compiled ;P
Unfortunately, I don't have time to make a full-fledged contrib out of
this and Larry's awk files.

-alex


On Tue, 1 Aug 2000, Larry Rosenman wrote:

> Any comments at all from anyone on my mail from Sunday Nite on
> making the macaddr_manuf function just return a 
> masked MACADDR (I.E. set the low 3 bytes to 0x00) and how we
> do this in the code?
> 
> Any comments on the ouiparse.awk script?
> 
> LER
> 
> 




pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: mac.c
Next
From: Thomas Lockhart
Date:
Subject: Re: random() function produces wrong range