Re: mac.c

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: mac.c
Date: 2000-08-02 03:06:44
Message-ID: Pine.BSO.4.10.10008012259421.4362-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>
>

In response to

  • mac.c at 2000-08-02 01:55:19 from Larry Rosenman

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-08-02 06:10:34 Re: [HACKERS] random() function produces wrong range
Previous Message Larry Rosenman 2000-08-02 01:55:19 mac.c