#!/bin/sh #============================================================================ # /etc/xen/vif-route # # Script for configuring a vif in routed mode. # Xend calls a vif script when bringing a vif up or down. # This script is the default - but it can be configured for each vif. # # Example invocation: # # vif-route up domain=VM1 vif=vif1.0 ip="128.232.38.45/28 10.10.10.55/24" # # Usage: # vif-route (up|down) {VAR=VAL}* # # Vars: # # domain name of the domain the interface is on (required). # vif vif interface name (required). # mac vif MAC address (required). # ip list of IP networks for the vif, space-separated (optional). #============================================================================ # Exit if anything goes wrong set -e echo "vif-route $*" # Operation name. OP=$1 shift # Pull variables in args into environment for arg ; do export "${arg}" ; done # Required parameters. Fail if not set. domain=${domain:?} vif=${vif:?} mac=${mac:?} # Optional parameters. Set defaults. ip=${ip:-''} # default to null (do nothing) main_ip=`ifconfig eth0 | grep "inet addr:" | sed -e 's/.*inet addr:\(\w\w*\.\w\w*\.\w\w*\.\w\w*\).*/\1/'` # Are we going up or down? case $OP in up) ifconfig ${vif} 169.254.1.0 netmask 255.255.255.255 up echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp iptcmd='-A' ipcmd='a' ;; down) ifconfig ${vif} down iptcmd='-D' ipcmd='d' ;; *) echo 'Invalid command: ' $OP echo 'Valid commands are: up, down' exit 1 ;; esac if [ ${ip} ] ; then # If we've been given a list of IP networks, allow pkts with these src addrs. for addr in ${ip} ; do ip r ${ipcmd} ${addr} dev ${vif} src ${main_ip} # iptables ${iptcmd} FORWARD -m physdev --physdev-in ${vif} -s ${addr} -j ACCEPT done # Always allow us to talk to a DHCP server anyhow. # iptables ${iptcmd} FORWARD -m physdev --physdev-in ${vif} -p udp --sport 68 --dport 67 -j ACCEPT fi 18970d94dfbc319a69f29ac6af'/>
path: root/common/sendchar_uart.c
blob: 0241859eb7087548f468698afeb1966e093a16a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
Copyright 2011 Jun Wako <wakojun@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "uart.h"
#include "sendchar.h"


int8_t sendchar(uint8_t c)
{
    uart_putchar(c);
    return 0;
}