Sponsored Content
Full Discussion: SCO get MAC Address
Top Forums Programming SCO get MAC Address Post 302106117 by jim mcnamara on Tuesday 6th of February 2007 03:57:16 PM
Old 02-06-2007
Code:
#include <stdio.h>

int main()
{
   
   FILE *cmd=popen("arp kcsdev | awk '{print $4}'", "r");
   char tmp[80]={0x0};
   
   while(fgets( tmp, sizeof(tmp), cmd)!=NULL)
   {
         printf("%s\n", tmp);
    }
   pclose(cmd);
   return 0;
}

kcsdev = node this was tested on. Change it.
 

10 More Discussions You Might Find Interesting

1. Programming

Get Mac Address

:( Hi I am trying to get Mac address of of my Sun server from my C program running on the host machine. Any suggestions . (1 Reply)
Discussion started by: ss_hpov
1 Replies

2. UNIX for Dummies Questions & Answers

Mac address

Hi Can some one help me How do find out Mac address in Tru64 Unix Thank you (1 Reply)
Discussion started by: Syed_45
1 Replies

3. IP Networking

How to Achive IP address through MAC(Ethernet) address

Hi sir, i want to make such programe which takes MAC(Ethernet) address of any host & give me its IP address....... but i'm nt getting that how i can pass the MAC address to Frame........ Please give me an idea for making such program... Thanks & regards Krishna (3 Replies)
Discussion started by: krishnacins
3 Replies

4. Solaris

Host ID vs MAC Address

Hi, I've got a Sun Solaris machine with host ID (840f8e57) and MAC address (0:14:4f:f:8e:57), how do I: 1. Write the MAC address in standard (IEEE 802) format, i.e. xx-xx-xx-xx-xx-xx? Do I need to add 0's before or after the 'f', i.e. 00-14-4f-0f-8e-57 or 00-14-4f-f0-8e-57? 2. What is... (4 Replies)
Discussion started by: TheBlueSky
4 Replies

5. Solaris

Get ip address from mac address

I have following message in my messages file on solaris 10 WARNING: e1000g3712000:3 has duplicate address 010.022.196.011 (in use by 00:50:56:85:25:ef); disabled Now is there any way i can find which server has 00:50:56:85:25:ef mac address either IP or Hostname ? (6 Replies)
Discussion started by: fugitive
6 Replies

6. SCO

MAC address

hi every one please help i want to change mac address in sco unix 5.0.6 how can i do this (3 Replies)
Discussion started by: kaydream
3 Replies

7. IP Networking

Tracing a MAC address to IP address: Solaris

Hi there I lost connectivity to one of our remote systems and when I checked the messages log I found the following: Aug 10 23:42:34 host xntpd: time reset (step) 1.681729 s Aug 16 13:20:51 host ip: WARNING: node "mac address" is using our IP address x.x.x.x on aggr1 Aug 16 13:20:51 host... (9 Replies)
Discussion started by: notreallyhere
9 Replies

8. SCO

Changing MAC address in SCO 5.0.6

Hi, For som reason i need to change MAC address of SCO Open Server 5.0.6. I have searched foe answer too much but i didn't fin any thing well.:mad: Please help me, Thx:cool::) (4 Replies)
Discussion started by: mammut3d
4 Replies

9. Shell Programming and Scripting

GREP mac address

Hi, mac.txt My mac address is <Mac Address>. How can i replace <Mac Address> with the actual of my computer? I try to GREP command as below but i am unable to grep it to replace just <Mac Address>. ifconfig eth0 | grep -o -E '(]{1,2}:){5}]{1,2}' Million in Advance. Please use... (7 Replies)
Discussion started by: derrickyee81
7 Replies

10. IP Networking

MAC Address - Four Interfaces with the same MAC Address

four interfaces with ifconfig all interfaces have the same mac. If is not set for unique. but it still works. what difference does it make to have all macs the same or different? (4 Replies)
Discussion started by: rrodgers
4 Replies
MAC_IS_PRESENT(3)					   BSD Library Functions Manual 					 MAC_IS_PRESENT(3)

NAME
mac_is_present -- report whether the running system has MAC support LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/mac.h> int mac_is_present(const char *policyname); DESCRIPTION
The mac_is_present() function determines whether the currently-running kernel supports MAC for a given policy or not. If policyname is non-NULL, the presence of the named policy (e.g. ``biba'', ``mls'', ``te'') is checked, otherwise the presence of any MAC policies at all is checked. RETURN VALUES
If the system supports the given MAC policy, the value 1 is returned. If the specified MAC policy is not supported, the value 0 is returned. If an error occurs, the value -1 is returned. ERRORS
[EINVAL] The value of policyname is not valid. [ENOMEM] Insufficient memory was available to allocate internal storage. SEE ALSO
mac(3), mac_free(3), mac_get(3), mac_prepare(3), mac_set(3), mac_text(3), mac(4), mac(9) HISTORY
Support for Mandatory Access Control was introduced in FreeBSD 5.0 as part of the TrustedBSD Project. BSD
July 7, 2006 BSD
All times are GMT -4. The time now is 04:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy